A waves file opened in the editor.
More...
#include </__w/project-rtype/project-rtype/client/network/include/rtype/level_editor.hpp>
|
| std::string | to_json (std::size_t first_wave=0) const |
| | The draft as a waves file, from one of its waves on.
|
| |
| void | save (const std::filesystem::path &path) const |
| | Writes the draft to a waves file, once the server would read it.
|
| |
| aegis2d::ecs::WaveSchedule | schedule (std::size_t first_wave=0) const |
| | The draft as the server plays it, from one of its waves on, for a playtest.
|
| |
|
| bool | loop = false |
| | Whether the waves play again from the first after the last.
|
| |
| std::vector< DraftWave > | waves {} |
| | The waves, in order.
|
| |
A waves file opened in the editor.
Each group of the file (count, every, step) becomes one enemy per member, so that each can be moved on its own; the waves they make are the same.
◆ from_file()
| static LevelDraft rtype::LevelDraft::from_file |
( |
const std::filesystem::path & |
path | ) |
|
|
static |
Reads a waves file, as the server does (load_waves()).
- Parameters
-
| path | JSON file in the format of ecs::WaveSchedule. |
- Returns
- The draft.
- Exceptions
-
| aegis2d::core::ConfigError | If the file cannot be read or is not valid waves. |
◆ save()
| void rtype::LevelDraft::save |
( |
const std::filesystem::path & |
path | ) |
const |
Writes the draft to a waves file, once the server would read it.
Written next to path first and checked as the server reads it (load_waves()): a draft the server would refuse, such as a wave with no enemy, leaves the file as it was.
- Parameters
-
| path | Waves file, created or replaced. |
- Exceptions
-
| aegis2d::core::ConfigError | If the server would refuse it, or the file cannot be written; the message says why. |
◆ schedule()
| aegis2d::ecs::WaveSchedule rtype::LevelDraft::schedule |
( |
std::size_t |
first_wave = 0 | ) |
const |
The draft as the server plays it, from one of its waves on, for a playtest.
- Parameters
-
| first_wave | Index of the first wave played. |
- Returns
- The schedule, at its start.
- Exceptions
-
| aegis2d::core::ConfigError | If it is not valid waves (a wave with no enemy...). |
◆ to_json()
| std::string rtype::LevelDraft::to_json |
( |
std::size_t |
first_wave = 0 | ) |
const |
The draft as a waves file, from one of its waves on.
Each enemy is a spawn of its own, at written when not 0; the waves before first_wave are left out.
- Parameters
-
| first_wave | Index of the first wave written. |
- Returns
- JSON in the format of
ecs::WaveSchedule.
◆ loop
| bool rtype::LevelDraft::loop = false |
Whether the waves play again from the first after the last.
◆ waves
| std::vector<DraftWave> rtype::LevelDraft::waves {} |
The documentation for this struct was generated from the following file: