4#include <aegis2d/ecs/waves.hpp>
39 Room(std::uint32_t
id, std::optional<std::uint64_t> seed, aegis2d::ecs::WaveSchedule waves,
51 [[nodiscard]] std::uint32_t
id() const noexcept;
68 [[nodiscard]] std::array<std::optional<std::
string>, tuning::max_players>&
names() noexcept;
74 std::array<std::optional<std::
string>, tuning::max_players> names_{};
Finds what changed in the game at each tick, as events.
Definition event_tracker.hpp:31
The one game of the server, with up to tuning::max_players players.
Definition game_instance.hpp:37
One game of the server: its GameInstance, the Simulation thread that runs it, the EventTracker of wha...
Definition room.hpp:26
std::array< std::optional< std::string >, tuning::max_players > & names() noexcept
Names of the players in the room's game, by number.
Room(const Room &)=delete
GameInstance & instance() noexcept
The game of the room.
std::function< void(Room &room, GameInstance &instance)> TickHandler
Called on the simulation thread after each tick of the room.
Definition room.hpp:29
~Room()=default
Stops the thread, then destroys the game.
Room & operator=(const Room &)=delete
std::uint32_t id() const noexcept
Number of the room in its server.
Simulation & simulation() noexcept
The thread running the game.
EventTracker & events() noexcept
What the clients of the room learnt of its entities.
Room & operator=(Room &&)=delete
Room(std::uint32_t id, std::optional< std::uint64_t > seed, aegis2d::ecs::WaveSchedule waves, std::uint32_t rate, TickHandler after_tick, bool trace=false, GameRules rules={})
Creates the game and starts its thread.
Runs a GameInstance on its own thread, tuning::tick_rate times per second.
Definition simulation.hpp:30
What changed in the server's game at each tick, as the events of RFC section 4.4.
The game run by the server, and the players of the sessions in it.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
Thread running the server's game at a fixed rate.
How a game plays: the rules of its room, as the gameplay reads them.
Definition server_game.hpp:35
Gameplay values of R-Type: play area, speeds, sizes, health, lives and scores.