Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

GameState.h

Go to the documentation of this file.
00001 /*
00002 CS Senior Project 2003
00003 Team : Leftfield
00004 Project : ModernWarfare
00005 Members :
00006 - Russ Christensen              <rchriste@cs.utah.edu>
00007 - Todd Smith                    <tcsmith@cs.utah.edu>
00008 - Usit Duongsaa                 <duongsaa@cs.utah.edu>
00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00012 
00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00016 */
00017 
00021 #pragma once
00022 
00023 #include "..\AEngine\AEngine.h"
00024 #include "Globals.h"      // MessagesReceived
00025 #include "MilitaryUnit.h"
00026 #include "City.h"
00027 #include "Map.h"
00028 #include "Player.h"
00029 #include "BattleEntry.h"
00030 
00031 enum ControlMode {NORMAL, GOD};
00032 
00033 class GameState
00034 {
00035 public:
00037   static vector<Player*>& players();
00039   static vector<MilitaryUnit*>& units();
00041   static vector<MilitaryUnit*>& selectedUnits();
00043   static vector<City*>& cities();
00045   static vector<DrawableObject*>& drawables();
00047   static void addMilitaryUnit(MilitaryUnit* unit);
00049   static MilitaryUnit* getMilitaryUnit(uint uniqueID);
00051   static void addCity(City* city);
00053   static City* getCity(uint uniqueID);
00055   static Player* findPlayer(const Vec3D& teamColor);
00057   static vector<BattleEntry*>& battles();
00059   static BattleEntry* activeBattle();
00061   static void setActiveBattle(BattleEntry* battle);
00063   static BattleEntry* getBattle(uint uniqueID);
00065   static MessagesReceived& messagesReceived(void);
00067   static Vec3D& camTarget();
00069   static void setWorldMap(const Map::WorldMap& map);
00070   static const Map::WorldMap& worldMap();
00073   static Player* consolePlayer();
00074   static void setConsolePlayer(Player* consolePlayer);
00077   static ControlMode controlMode();
00078   static void setControlMode(ControlMode mode);
00079 
00080         // for sending reinforcement to currently active battle
00081         static vector<int>& availableRFM();             // number of available battlalions that can assist the active battle
00082                                                                                         // they are counted separately for each of the 5 types
00083   
00084 private:
00085   GameState();
00086   static BattleEntry* m_activeBattle;
00087   static Map::WorldMap m_worldMap;
00088   static Player* m_consolePlayer;
00089   static ControlMode m_controlMode;
00090 };

Generated on Wed Apr 23 05:50:15 2003 for Modern Warfare by doxygen1.3-rc2