|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Represents the state of the world in the game, including the map size, tile contents, players, eggs, and teams. More...
#include <WorldState.hpp>
Collaboration diagram for WorldState:Public Member Functions | |
| Resources & | at (int x, int y) |
| Accesses the resources at a specific tile coordinate (x, y). | |
| const Resources & | at (int x, int y) const |
| Accesses the resources at a specific tile coordinate (x, y). | |
| bool | playerExists (int id) const |
| Checks if a player with the given ID exists in the world. | |
| bool | eggExists (int id) const |
| Checks if an egg with the given ID exists in the world. | |
| void | purgeDyingPlayers () const |
Public Attributes | |
| int | width |
| int | height |
| std::vector< Resources > | tiles |
| std::unordered_map< int, Player > | players |
| std::unordered_map< int, Player > | dyingPlayers |
| std::unordered_map< int, Egg > | eggs |
| std::vector< std::string > | teams |
Represents the state of the world in the game, including the map size, tile contents, players, eggs, and teams.
Definition at line 63 of file WorldState.hpp.
|
inline |
Accesses the resources at a specific tile coordinate (x, y).
Definition at line 76 of file WorldState.hpp.
Referenced by GameState::_applyPlayerResourceDrop(), GameState::_applyPlayerResourceTake(), GameState::_applyTileContent(), EntityTooltipWidget::_rebuild(), and RaylibRenderer::_render3D().
Here is the caller graph for this function:
|
inline |
Accesses the resources at a specific tile coordinate (x, y).
Definition at line 81 of file WorldState.hpp.
|
inline |
Checks if an egg with the given ID exists in the world.
Definition at line 91 of file WorldState.hpp.
References eggs.
Referenced by EntityTooltipWidget::_rebuild().
Here is the caller graph for this function:
|
inline |
Checks if a player with the given ID exists in the world.
Definition at line 86 of file WorldState.hpp.
References players.
Referenced by CameraController::_followTarget(), EntityTooltipWidget::_isPlayerCase(), and EntityTooltipWidget::_rebuild().
Here is the caller graph for this function:
|
inline |
Definition at line 93 of file WorldState.hpp.
References dyingPlayers.
Referenced by RaylibRenderer::_render3D().
Here is the caller graph for this function:
|
mutable |
Definition at line 69 of file WorldState.hpp.
Referenced by GameState::_applyPlayerDeath(), RaylibRenderer::_render3D(), and purgeDyingPlayers().
| std::unordered_map<int, Egg> WorldState::eggs |
Definition at line 70 of file WorldState.hpp.
Referenced by GameState::_applyEggDeath(), GameState::_applyEggHatch(), GameState::_applyEggNew(), GameState::_applyServerSpawnedEgg(), RaylibRenderer::_drawSelectionHighlight(), EntityTooltipWidget::_rebuild(), RaylibRenderer::_render3D(), eggExists(), SelectionFinder::findFromRay(), and HeadlessRenderer::render().
| int WorldState::height |
Definition at line 66 of file WorldState.hpp.
Referenced by GameState::_applyEggNew(), GameState::_applyIncantationStart(), GameState::_applyMapSize(), GameState::_applyPlayerBroadcast(), GameState::_applyPlayerNew(), GameState::_applyPlayerPosition(), GameState::_applyServerSpawnedEgg(), RaylibRenderer::_drawSelectionHighlight(), RaylibRenderer::_groupLabelAnchor(), RaylibRenderer::_render3D(), HudWidget::draw(), SelectionFinder::findFromRay(), HeadlessRenderer::render(), and RaylibRenderer::render().
| std::unordered_map<int, Player> WorldState::players |
Definition at line 68 of file WorldState.hpp.
Referenced by GameState::_applyEggNew(), GameState::_applyIncantationEnd(), GameState::_applyIncantationStart(), GameState::_applyPlayerBroadcast(), GameState::_applyPlayerDeath(), GameState::_applyPlayerInventory(), GameState::_applyPlayerLevel(), GameState::_applyPlayerNew(), GameState::_applyPlayerPosition(), GameState::_applyPlayerResourceDrop(), GameState::_applyPlayerResourceTake(), RaylibRenderer::_drawSelectionHighlight(), CameraController::_followTarget(), RaylibRenderer::_groupPlayersByVisualProximity(), EntityTooltipWidget::_rebuild(), RaylibRenderer::_render3D(), HudWidget::draw(), SelectionFinder::findFromRay(), PlayerPanel::handleInput(), playerExists(), and HeadlessRenderer::render().
| std::vector<std::string> WorldState::teams |
Definition at line 71 of file WorldState.hpp.
Referenced by GameState::_applyTeamName(), RaylibRenderer::_initTeamColors(), HudWidget::draw(), and HeadlessRenderer::render().
| std::vector<Resources> WorldState::tiles |
Definition at line 67 of file WorldState.hpp.
Referenced by GameState::_applyMapSize(), at(), and at().
| int WorldState::width |
Definition at line 65 of file WorldState.hpp.
Referenced by GameState::_applyEggNew(), GameState::_applyIncantationStart(), GameState::_applyMapSize(), GameState::_applyPlayerBroadcast(), GameState::_applyPlayerNew(), GameState::_applyPlayerPosition(), GameState::_applyServerSpawnedEgg(), RaylibRenderer::_drawSelectionHighlight(), RaylibRenderer::_groupLabelAnchor(), RaylibRenderer::_render3D(), at(), at(), HudWidget::draw(), SelectionFinder::findFromRay(), HeadlessRenderer::render(), and RaylibRenderer::render().