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

globals.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 
00022 #pragma once
00023 
00024 #include "..\AEngine\AEngine.h"
00025 #include "Defs.h"
00026 #include "Map.h"
00027 
00028 
00029 const int MAX_TREE = 200;
00030 const int MAX_ROCK = 80;
00031 typedef unsigned int uint;
00032 
00037 namespace NetworkMessages {
00038         /* General commands */
00039         const string NETWORK_DATA("receiveNetworkData:");
00040         const string COMMIT_TIME("CommitTime");
00041         const string COMMAND_CHAT("Chat");
00042         const string COMMAND_START_GAME("StartGameCommand");
00043         const string COMMAND_SYNC("CommandSync");
00044         const string RANDOM_SEED_VALUE("RandomSeedValue");
00045         const string COMMAND_PRINT_A_RANDOM_NUMBER_TO_THE_CONSOLE("PrintARandomNumberToTheConsole");
00046         const string COMMAND_TEXT_MESSAGE("TextMessageCommand");
00047         const string COMMAND_MORE_MONEY("CommandMoreMoney");
00048         const string COMMAND_SEND_MONEY("CommandSendMoney");
00049         const string COMMAND_ASK_FOR_RANDOM_NUMBER("CommandAskForRandomNumber");
00050         const string COMMAND_RANDOM_NUMBER_ANSWER("CommandRandomNumberAnswer");
00051         const string COMMAND_SEND_JET_REINFORCEMENT("CommandSendJetReinforcement");
00052         const string COMMAND_SEND_UNIT_REINFORCEMENT("CommandSendUnitReinforcement");
00053         /* Overhead commands */
00054         const string COMMAND_OVERHEAD("OverheadCommand");
00055         const string REQUEST_NEW_LIGHT_TANK("RequestNewLightTank");
00056         const string UNIT_NUMBER("UnitNumber");
00057         const string COMMAND_GOAL("CommandGoal");
00058         const string END_GAME_TICK("EndGameTick");
00059         const string COMMAND_BUILD_LIGHTTANK("BuildLightTank");
00060         const string COMMAND_BUILD_HEAVYTANK("BuildHeavyTank");
00061         const string COMMAND_BUILD_ROCKET_LAUNCHER("BuildRocketLauncher");
00062         const string COMMAND_BUILD_ARTILLERY("BuildArtillery");
00063         const string COMMAND_BUILD_JET("BuildJet");
00064         const string COMMAND_BUILD_ECON("BuildEcon");
00065         const string COMMAND_SET_RALLY_POINT("SetRallyPointForCity");
00066         /* Battlemode Commands */
00067         const string COMMAND_BEGINBATTLE("BeginBattle");
00068         const string COMMAND_BATTLEMODE("BattlemodeCommand");
00069         const string COMMAND_BATTLE_ID("BattleID");
00070 
00071         void sendBuildMessage(const string& buildMsg, unsigned int cityID);
00072 }
00073 
00075 namespace Globals {
00076         typedef vector<MilitaryUnit*>::iterator UnitIter;
00077         typedef vector<DrawableObject*>::iterator DrawableIter;
00078         typedef vector<City*>::iterator CityIter;
00079         typedef vector<BattleEntry*>::iterator BattleIter;
00080         typedef vector<Player*> PlayerVec;
00081         typedef vector<Player*>::iterator PlayerIter;
00082         const string WARNING("WARNING:");
00083 
00084         class ArtWork;
00085         extern const ArtWork* artWork;
00086 
00087         extern int currGameTick;
00088         const int NETWORK_GAME_TICK_LAG(10);
00092         const int NETWORK_SYNC_RATE(5);
00093         const int DEFAULT_SERVER_PORT(4040);
00094         //These numbers are the ideal numbers for the way the pathing algorithm works in BattleMode.
00095         //only change these numbers when you change the pathing algorithm
00096         const int DEFAULT_LIGHT_TANK_SIZE(30);
00097         const int DEFAULT_HEAVY_TANK_SIZE(16);
00098         const int DEFAULT_ROCKET_LAUNCHER_SIZE(24);
00099         const int DEFAULT_ARTILLERY_SIZE(18);
00100         const int MAX_MONEY(10000);
00101         const int MAX_UNITS_FOR_EACH_PLAYER(35);
00102         const int MESSAGE_DISPLAY_LENGTH(600);
00103 
00106         static const Vec3D NO_OWNER(0.655f, 0.655f, 0.655f);
00107 
00108         const FLOAT BATTLE_RADIUS = 100.0f;
00109         const FLOAT BATTLE_CIRCLE_HEIGHT(15.5f);
00110 
00112         bool OverheadCollisonWithIdleUnit(MilitaryUnit* unit);
00114         bool OverheadCollisionWithCity(MilitaryUnit* unit);
00115 
00117         static const int MOUSE_RENDER_PRIORITY(9);
00118 
00119         class MessagesReceived
00120         {
00121         public:
00122                 MessagesReceived(void);
00123                 void print(void);
00124                 void addMessage(string str);
00125         private:
00126                 vector<pair<int, string> > m_data;
00127         };
00128 
00129 
00130 
00132 class ArtWork
00133 {
00134 public:
00135         ArtWork(void);
00136         ~ArtWork(void);
00137 
00138         ATerrain worldMap;
00139 
00140         const ATexture mouse;
00141         const ATexture terrainTexture;
00142         const AMesh terrainMesh;
00143         const ATexture lightTank_texture;
00144         const AMesh lightTank_mesh;
00145         const AMesh lightTankTurret_mesh;
00146         const ATexture city_texture;
00147         const AMesh city_mesh;
00148         
00149         const AMesh             heavyTank_mesh;                                 // heavy tank
00150         const AMesh             heavyTankTurret_mesh;
00151         const ATexture  heavyTank_texture;
00152         const AMesh             launcher_mesh;                                  // rocket launcher
00153         const ATexture  launcher_texture;
00154         const AMesh             artillery_mesh;                                 // artillery
00155         const AMesh             artilleryTurret_mesh;
00156         const ATexture  artillery_texture;
00157         const AMesh             jet_mesh;                                               // jet
00158         const ATexture  jet_texture;
00159 
00160         // Usit's BattleMode
00161         const AMesh             battleGroupMesh;
00162         const ATexture  battleGroupTexture;
00163         const AMesh             battleShellMesh;
00164         const AMesh             battleRocketMesh;
00165         const AMesh             battleICBMMesh;
00166         const ATexture  battleBulletTexture;    // apply to shell, rocket & icbm
00167         const ATexture  debrisTex;
00168         const AMesh             debris1, debris2;
00169 
00170         const AMesh             skyMesh;
00171         const ATexture  skyTexture;
00172         const ATexture  terrainTexLow, terrainTexHigh, terrainTexNormal;
00173 
00174         vector<ATerrain>  battleTerrains;
00175         Vec3D   trees[MAX_TREE];
00176         Vec3D   rocks[MAX_ROCK];
00177 
00178         // particles
00179         const ATexture flareTexture;
00180         const ATexture smokeTextureSmall;
00181         const ATexture smokeTextureLarge;
00182         const ATexture exploTextureSmall;
00183         const ATexture exploTextureLarge;
00184         const ATexture artilTextureShell;
00185         const ATexture shadow;
00186 
00187         // environment
00188         const AMesh        envRockMesh;
00189         const AMesh    envTreeMesh;
00190         const ATexture envRockTex;
00191         const ATexture envTreeTex;
00192 
00193         // Interface textures
00194         const ATexture buildMenuTex;
00195         const ATexture jetsIconTex;
00196         const ATexture hud;
00197         const ATexture portraitLT, portraitHT, portraitLA, portraitAR, portraitJE;
00198         const ATexture switchToOverhead;
00199         const ATexture upgradeEconTex;
00200         const ATexture minimapBattleIcon;
00201 
00202         const ATexture butStop;
00203         const ATexture butJetGuard;
00204         const ATexture butJetBomb;
00205 
00206         const ATexture playersNBattlesListTex;
00207 
00208         const ATexture confirmQuit;
00209         const ATexture youWinTex;
00210         const ATexture youLoseTex;
00211 
00212         // calling ReinForceMent in battle mode
00213         const ATexture callRFMIconTex;
00214         const ATexture callRFMPanelTex;
00215 
00216         // main menu
00217         const ATexture main_leftField;
00218         const ATexture main_sponsorMS;
00219         const ATexture main_sponsorNV;
00220         const ATexture main_sponsorPF;
00221         const ATexture main_menuTex;
00222         const ATexture main_multiplayTex;
00223 
00224         // interface symbols
00225         const AMesh     circle;
00226         const AMesh thinCircle;
00227         const AMesh crossHair;
00228 
00229         // pure colors
00230         const ATexture colorGreen;
00231         const ATexture colorRed;
00232         const ATexture colorBlue;
00233 private:
00235         ArtWork& operator=(const ArtWork& rhs);
00236 };
00237 } //end namespace
00238 
00239 using namespace Globals;
00240 

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