std::variant< MapSize, TileContent, TeamName, PlayerNew, PlayerPosition, PlayerLevel, PlayerInventory, PlayerExpulsion, PlayerBroadcast, IncantationStart, IncantationEnd, PlayerFork, PlayerResourceDrop, PlayerResourceTake, PlayerDeath, EggNew, EggHatch, EggDeath, TimeUnit, TimeUnitChange, GameEnd, ServerMessage, UnknownCommand, BadParameters, ServerUptime, ServerSpawnedEgg, WinDuration > Event
Represents an event received from the server. Is a variant of all possible events,...
Represents the current state of the game. Knows the world state, some metadata, and how to apply even...
bool isDirty() const
Checks if the game state has been modified since the last time it was cleared (dirty flag).
unsigned int serverUptimeSeconds
void _applyPlayerInventory(const PlayerInventory &e)
int64_t gameDurationTicks
void _applyTimeUnitChange(const TimeUnitChange &e)
void _applyIncantationStart(const IncantationStart &e)
static void _pushBehavior(VisualState &visual, std::unique_ptr< IBehavior > b)
void _applyServerUptime(const ServerUptime &e)
void _applyTileContent(const TileContent &e)
void _applyPlayerDeath(const PlayerDeath &e)
void clearDirty() const
Sets the dirty flag to false.
void _applyPlayerResourceDrop(const PlayerResourceDrop &e)
void _applyTeamName(const TeamName &e)
void _applyPlayerBroadcast(const PlayerBroadcast &e)
void _applyPlayerExpulsion(const PlayerExpulsion &e)
void _applyMapSize(const MapSize &e)
void _applyPlayerLevel(const PlayerLevel &e)
void _applyTimeUnit(const TimeUnit &e)
void _applyServerSpawnedEgg(const ServerSpawnedEgg &e)
void _applyEggNew(const EggNew &e)
void _applyEggDeath(const EggDeath &e)
void applyEvent(const Event &e)
Applies an event to the game state, modifying it accordingly and setting the dirty flag.
void _applyPlayerResourceTake(const PlayerResourceTake &e)
void _applyEggHatch(const EggHatch &e)
void _applyIncantationEnd(const IncantationEnd &e)
void _applyPlayerNew(const PlayerNew &e)
void _applyWinDuration(const WinDuration &e)
void _applyPlayerFork(const PlayerFork &e)
void _applyPlayerPosition(const PlayerPosition &e)
void _applyGameEnd(const GameEnd &e)
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...
Represents the state of the world in the game, including the map size, tile contents,...