00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
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
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
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
00095
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;
00150 const AMesh heavyTankTurret_mesh;
00151 const ATexture heavyTank_texture;
00152 const AMesh launcher_mesh;
00153 const ATexture launcher_texture;
00154 const AMesh artillery_mesh;
00155 const AMesh artilleryTurret_mesh;
00156 const ATexture artillery_texture;
00157 const AMesh jet_mesh;
00158 const ATexture jet_texture;
00159
00160
00161 const AMesh battleGroupMesh;
00162 const ATexture battleGroupTexture;
00163 const AMesh battleShellMesh;
00164 const AMesh battleRocketMesh;
00165 const AMesh battleICBMMesh;
00166 const ATexture battleBulletTexture;
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
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
00188 const AMesh envRockMesh;
00189 const AMesh envTreeMesh;
00190 const ATexture envRockTex;
00191 const ATexture envTreeTex;
00192
00193
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
00213 const ATexture callRFMIconTex;
00214 const ATexture callRFMPanelTex;
00215
00216
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
00225 const AMesh circle;
00226 const AMesh thinCircle;
00227 const AMesh crossHair;
00228
00229
00230 const ATexture colorGreen;
00231 const ATexture colorRed;
00232 const ATexture colorBlue;
00233 private:
00235 ArtWork& operator=(const ArtWork& rhs);
00236 };
00237 }
00238
00239 using namespace Globals;
00240