#include <GameState.h>
Collaboration diagram for GameState:

Static Public Methods | |
| vector< Player * > & | players () |
| The global list of players. | |
| vector< MilitaryUnit * > & | units () |
| The global list of military units. | |
| vector< MilitaryUnit * > & | selectedUnits () |
| The list of units currently selected. | |
| vector< City * > & | cities () |
| The global list of cities. | |
| vector< DrawableObject * > & | drawables () |
| The global list of drawable objects. (list of units and cities). | |
| void | addMilitaryUnit (MilitaryUnit *unit) |
| Add a unit to the game state. | |
| MilitaryUnit * | getMilitaryUnit (uint uniqueID) |
| returns a pointer to the military unit with the uniqueID given or NULL if no unit exists. | |
| void | addCity (City *city) |
| Add a city to the game state. | |
| City * | getCity (uint uniqueID) |
| returns a pointer to the city with the uniqueID given or NULL if no city exists. | |
| Player * | findPlayer (const Vec3D &teamColor) |
| Find a player given the team color. | |
| vector< BattleEntry * > & | battles () |
| The battles happening in the game. | |
| BattleEntry * | activeBattle () |
| The currently active battle. | |
| void | setActiveBattle (BattleEntry *battle) |
| Set the active battle. | |
| BattleEntry * | getBattle (uint uniqueID) |
| returns a pointer to the battle with the uniqueID given or NULL if no battle exists. | |
| MessagesReceived & | messagesReceived (void) |
| For printing chat messages received over the network. | |
| Vec3D & | camTarget () |
| The camera target, the point where the camera is centered. | |
| void | setWorldMap (const Map::WorldMap &map) |
| Set the world map, contains bounds the units must be contained in. | |
| const Map::WorldMap & | worldMap () |
| Player * | consolePlayer () |
| Gets and sets for the player sitting at the console. i.e. physically at the machine the game is running on. | |
| void | setConsolePlayer (Player *consolePlayer) |
| ControlMode | controlMode () |
| Get and set for the control mode: NORMAL --> player can only control their side GOD --> player can control all sides. | |
| void | setControlMode (ControlMode mode) |
| vector< int > & | availableRFM () |
Private Methods | |
| GameState () | |
Static Private Attributes | |
| BattleEntry * | m_activeBattle |
| Map::WorldMap | m_worldMap |
| Player * | m_consolePlayer |
| ControlMode | m_controlMode |
|
|
|
|
|
The currently active battle.
Definition at line 123 of file GameState.cpp. References m_activeBattle. Referenced by BattleGroup::destroyUnit(), Overhead::doCollisionDetection(), BattleGroup::fire(), BattleJets::fireAntiAirMissiles(), BattleJets::fireAntiSurfaceMissiles(), Overhead::overhead_render(), Overhead::overhead_update(), Overhead::processInput(), HUD::processOverheadInput(), HUD::render(), sendReinforcement(), HUD::switchToNextBattle(), HUD::switchToPrevBattle(), BattleJets::takeHit(), and Overhead::updateBattleEntries().
00124 {
00125 return m_activeBattle;
00126 }
|
|
|
Add a city to the game state.
Definition at line 70 of file GameState.cpp. References cities(), and drawables(). Referenced by Overhead::loadMap().
|
|
|
Add a unit to the game state.
Definition at line 54 of file GameState.cpp. References drawables(), and units(). Referenced by Overhead::loadMap(), City::update(), and Overhead::updateBattleEntries().
|
|
|
Definition at line 171 of file GameState.cpp. Referenced by Overhead::overhead_init(), Overhead::overhead_update(), and HUD::render().
00172 {
00173 static vector<int> availableRFMVec;
00174 return availableRFMVec;
00175 }
|
|
|
The battles happening in the game.
Definition at line 92 of file GameState.cpp. Referenced by Overhead::doTutorial(), Overhead::doVictoryTest(), getBattle(), Overhead::overheadRender(), HUD::processMiniMapInput(), Overhead::processOverheadInput(), HUD::processOverheadInput(), HUD::renderMiniMap(), HUD::switchToNextBattle(), HUD::switchToPrevBattle(), and Helper::totalUnitsForPlayer().
00093 {
00094 static vector<BattleEntry*> theBattles;
00095 return theBattles;
00096 }
|
|
|
The camera target, the point where the camera is centered.
Definition at line 114 of file GameState.cpp. References Vec3D. Referenced by Overhead::overhead_init(), Overhead::overhead_update(), HUD::processMiniMapInput(), and Overhead::processOverheadInput().
00115 {
00116 static Vec3D m_camTarget(0.0f, 0.0f, 0.0f);
00117 return m_camTarget;
00118 }
|
|
|
The global list of cities.
Definition at line 42 of file GameState.cpp. Referenced by addCity(), Overhead::doVictoryTest(), getCity(), Jet::goal(), Overhead::overhead_init(), Globals::OverheadCollisionWithCity(), HUD::renderMiniMap(), Helper::totalCitiesForPlayer(), and Helper::totalUnitsBeingBuiltForPlayer().
00043 {
00044 static vector<City*> m_cities;
00045 return m_cities;
00046 }
|
|
|
Gets and sets for the player sitting at the console. i.e. physically at the machine the game is running on.
Definition at line 149 of file GameState.cpp. References m_consolePlayer. Referenced by Overhead::amIInThisBattle(), Overhead::doCollisionDetection(), Overhead::doVictoryTest(), BattleGroup::fire(), BattleEntry::initBattle(), Overhead::overhead_update(), Overhead::processCommand(), NetworkSubsystem::processNetworkData(), Overhead::processOverheadInput(), HUD::processOverheadInput(), HUD::render(), City::trainUnit(), and City::update().
00150 {
00151 return m_consolePlayer;
00152 }
|
|
|
Get and set for the control mode: NORMAL --> player can only control their side GOD --> player can control all sides.
Definition at line 161 of file GameState.cpp. References ControlMode, and m_controlMode. Referenced by BattleEntry::inputSelectGroups(), and Overhead::processOverheadInput().
00162 {
00163 return m_controlMode;
00164 }
|
|
|
The global list of drawable objects. (list of units and cities).
Definition at line 48 of file GameState.cpp. Referenced by addCity(), and addMilitaryUnit().
00049 {
00050 static vector<DrawableObject*> m_drawables;
00051 return m_drawables;
00052 }
|
|
|
Find a player given the team color.
Definition at line 85 of file GameState.cpp. References players(). Referenced by Overhead::updateBattleEntries().
|
|
|
returns a pointer to the battle with the uniqueID given or NULL if no battle exists.
Definition at line 98 of file GameState.cpp. References battles().
00099 {
00100 for(vector<BattleEntry*>::iterator iter = battles().begin(); iter != battles().end(); ++iter)
00101 {
00102 BattleEntry* battle = *iter;
00103 if((*iter)->uniqueID() == uniqueID) return *iter;
00104 }
00105 return 0;
00106 }
|
|
|
returns a pointer to the city with the uniqueID given or NULL if no city exists.
Definition at line 76 of file GameState.cpp. References cities(). Referenced by Jet::goal(), Jet::Jet(), Overhead::updateBattleEntries(), and Jet::~Jet().
|
|
|
returns a pointer to the military unit with the uniqueID given or NULL if no unit exists.
Definition at line 60 of file GameState.cpp. References units().
|
|
|
For printing chat messages received over the network.
Definition at line 108 of file GameState.cpp. Referenced by City::changeOwner(), Overhead::doCollisionDetection(), Overhead::overhead_init(), Overhead::overhead_render(), Overhead::overhead_update(), Overhead::printPlayerList(), Overhead::processCommand(), NetworkSubsystem::processNetworkData(), and City::trainUnit().
00109 {
00110 static MessagesReceived theMessagesReceived;
00111 return theMessagesReceived;
00112 }
|
|
|
The global list of players.
Definition at line 24 of file GameState.cpp. Referenced by findPlayer(), Helper::playerNumberToPlayerPointer(), and NetworkSubsystem::processNetworkData().
00025 {
00026 static vector<Player*> m_players;
00027 return m_players;
00028 }
|
|
|
The list of units currently selected.
Definition at line 36 of file GameState.cpp. Referenced by HUD::processMiniMapInput().
00037 {
00038 static vector<MilitaryUnit*> m_selectedUnits;
00039 return m_selectedUnits;
00040 }
|
|
|
Set the active battle.
Definition at line 128 of file GameState.cpp. References m_activeBattle. Referenced by Overhead::doCollisionDetection(), Overhead::overhead_update(), HUD::processMiniMapInput(), Overhead::processOverheadInput(), HUD::switchToNextBattle(), HUD::switchToOverhead(), HUD::switchToPrevBattle(), and Overhead::updateBattleEntries().
00129 {
00130 m_activeBattle = battle;
00131 }
|
|
|
Definition at line 154 of file GameState.cpp. References m_consolePlayer. Referenced by Overhead::overhead_init().
00155 {
00156 m_consolePlayer = cp;
00157 }
|
|
|
Definition at line 166 of file GameState.cpp. References m_controlMode. Referenced by Overhead::overhead_init(), and Overhead::processCommand().
00167 {
00168 m_controlMode = mode;
00169 }
|
|
|
Set the world map, contains bounds the units must be contained in.
Definition at line 136 of file GameState.cpp. References m_worldMap. Referenced by Overhead::loadMap().
00137 {
00138 m_worldMap = map;
00139 }
|
|
|
The global list of military units.
Definition at line 30 of file GameState.cpp. Referenced by addMilitaryUnit(), City::changeOwner(), Overhead::doVictoryTest(), getMilitaryUnit(), Overhead::getSelectedUnits(), Overhead::getSurroundingUnits(), Overhead::overhead_update(), Globals::OverheadCollisonWithIdleUnit(), HUD::renderMiniMap(), sendReinforcement(), Overhead::setSelectedUnits(), Helper::totalUnitsForPlayer(), and Overhead::updateBattleEntries().
00031 {
00032 static vector<MilitaryUnit*> m_units;
00033 return m_units;
00034 }
|
|
|
Definition at line 141 of file GameState.cpp. References m_worldMap. Referenced by MilitaryUnit::move(), HUD::processMiniMapInput(), and Overhead::processOverheadInput().
00142 {
00143 return m_worldMap;
00144 }
|
|
|
Definition at line 121 of file GameState.cpp. Referenced by activeBattle(), and setActiveBattle(). |
|
|
Definition at line 147 of file GameState.cpp. Referenced by consolePlayer(), and setConsolePlayer(). |
|
|
Referenced by controlMode(), and setControlMode(). |
|
|
Definition at line 134 of file GameState.cpp. Referenced by setWorldMap(), and worldMap(). |
1.3-rc2