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

Globals Namespace Reference


Detailed Description

All global variables should be declared extern here and implemented in Globals.cpp.


Compounds

class  ArtWork
 All models, 3d meshs, bump maps and other artwork needed by the game will be stored here. More...

class  MessagesReceived

Typedefs

typedef vector< MilitaryUnit
* >::iterator 
UnitIter
typedef vector< DrawableObject
* >::iterator 
DrawableIter
typedef vector< City
* >::iterator 
CityIter
typedef vector< BattleEntry
* >::iterator 
BattleIter
typedef vector< Player * > PlayerVec
typedef vector< Player
* >::iterator 
PlayerIter

Functions

bool OverheadCollisonWithIdleUnit (MilitaryUnit *unit)
 Returns true if unit collides with any of the non-moving units.

bool OverheadCollisionWithCity (MilitaryUnit *unit)
 Returns true if the unit is on top of a City.

const string WARNING ("WARNING:")
const int NETWORK_GAME_TICK_LAG (10)
const int NETWORK_SYNC_RATE (5)
 whenever currGameTick NETWORK_SYNC_RATE == 0 then a sync message is sent. Russ did bandwidth testing on 31Mar2003. Setting the value to 5 for two clients had the server @ outgoing 3.5kbs and incomming 2.0kbs And for a value of 1 for the two clients the server @ outgoing 45kbs and incomming 20kbs

const int DEFAULT_SERVER_PORT (4040)
const int DEFAULT_LIGHT_TANK_SIZE (30)
const int DEFAULT_HEAVY_TANK_SIZE (16)
const int DEFAULT_ROCKET_LAUNCHER_SIZE (24)
const int DEFAULT_ARTILLERY_SIZE (18)
const int MAX_MONEY (10000)
const int MAX_UNITS_FOR_EACH_PLAYER (35)
const int MESSAGE_DISPLAY_LENGTH (600)
const Vec3D NO_OWNER (0.655f, 0.655f, 0.655f)
 Defines a neutral owner. So cities and units(possibly) can be taken over by other players. i.e. they are neutral.

const FLOAT BATTLE_CIRCLE_HEIGHT (15.5f)
const int MOUSE_RENDER_PRIORITY (9)
 Priority to render mouse. Mouse should be rendered last.


Variables

const ArtWorkartWork = 0
int currGameTick
const FLOAT BATTLE_RADIUS = 100.0f


Typedef Documentation

typedef vector<BattleEntry*>::iterator Globals::BattleIter
 

Definition at line 79 of file globals.h.

Referenced by HUD::processMiniMapInput(), HUD::renderMiniMap(), HUD::switchToNextBattle(), HUD::switchToPrevBattle(), and Overhead::updateBattleEntries().

typedef vector<City*>::iterator Globals::CityIter
 

Definition at line 78 of file globals.h.

typedef vector<DrawableObject*>::iterator Globals::DrawableIter
 

Definition at line 77 of file globals.h.

Referenced by Overhead::deleteMilitaryUnit(), and Overhead::overheadRender().

typedef vector<Player*>::iterator Globals::PlayerIter
 

Definition at line 81 of file globals.h.

Referenced by Overhead::updatePlayers().

typedef vector<Player*> Globals::PlayerVec
 

Definition at line 80 of file globals.h.

typedef vector<MilitaryUnit*>::iterator Globals::UnitIter
 

Definition at line 76 of file globals.h.


Function Documentation

const FLOAT BATTLE_CIRCLE_HEIGHT 15.    5f
 

Referenced by BattleEntry::contains(), and Overhead::overheadRender().

const int DEFAULT_ARTILLERY_SIZE 18   
 

const int DEFAULT_HEAVY_TANK_SIZE 16   
 

const int DEFAULT_LIGHT_TANK_SIZE 30   
 

const int DEFAULT_ROCKET_LAUNCHER_SIZE 24   
 

const int DEFAULT_SERVER_PORT 4040   
 

const int MAX_MONEY 10000   
 

Referenced by Bank::deposit(), and Overhead::overhead_update().

const int MAX_UNITS_FOR_EACH_PLAYER 35   
 

Referenced by City::trainUnit().

const int MESSAGE_DISPLAY_LENGTH 600   
 

Referenced by Overhead::overhead_update(), and Globals::MessagesReceived::print().

const int MOUSE_RENDER_PRIORITY   [static]
 

Priority to render mouse. Mouse should be rendered last.

const int NETWORK_GAME_TICK_LAG 10   
 

Referenced by Overhead::askForRandomNumbers(), NetworkSubsystem::hasNetworkDataForCurrentTickBeenReceived(), BattleEntry::inputIssueGroupCommand(), BattleEntry::inputIssueJetsCommand(), Overhead::overhead_update(), Overhead::processCommand(), HUD::processMiniMapInput(), NetworkSubsystem::processNetworkData(), Overhead::processOverheadInput(), NetworkMessages::sendBuildMessage(), Overhead::sendMessageToPrintARandomNumberToTheConsole(), and sendReinforcement().

const int NETWORK_SYNC_RATE  
 

whenever currGameTick NETWORK_SYNC_RATE == 0 then a sync message is sent. Russ did bandwidth testing on 31Mar2003. Setting the value to 5 for two clients had the server @ outgoing 3.5kbs and incomming 2.0kbs And for a value of 1 for the two clients the server @ outgoing 45kbs and incomming 20kbs

Referenced by NetworkData::hasDataForGameTickArrived().

const Vec3D NO_OWNER 0.    655f,
0.    655f,
0.    655f
[static]
 

Defines a neutral owner. So cities and units(possibly) can be taken over by other players. i.e. they are neutral.

bool Globals::OverheadCollisionWithCity MilitaryUnit   unit
 

Returns true if the unit is on top of a City.

Definition at line 60 of file Globals.cpp.

References GameState::cities().

Referenced by MilitaryUnit::move().

00061 {
00062         for(CityIter cityIter(GameState::cities().begin()); cityIter < GameState::cities().end(); ++cityIter)
00063         {
00064                 if((*cityIter)->collision(unit))
00065                 {
00066                         return true;
00067                 }
00068         }
00069         return false;
00070 }

bool Globals::OverheadCollisonWithIdleUnit MilitaryUnit   unit
 

Returns true if unit collides with any of the non-moving units.

Definition at line 47 of file Globals.cpp.

References MilitaryUnit::collision(), and GameState::units().

Referenced by Jet::move(), and MilitaryUnit::move().

00048 {
00049         for(UnitIter iter(GameState::units().begin()); iter != GameState::units().end(); ++iter) 
00050         {
00051                 if (*iter == unit) continue;
00052                 if (unit->collision(*iter) && (*iter)->isIdle()) 
00053                 {
00054                         return true;
00055                 }
00056         }
00057         return false;
00058 }

const string WARNING "WARNING:"   
 

Referenced by NetworkData::addData(), City::deleteJetGuard(), getGameTick(), NetworkSubsystem::processNetworkData(), and BattleEntry::processQueuedInput().


Variable Documentation

const ArtWork * Globals::artWork = 0
 

Definition at line 41 of file Globals.cpp.

Referenced by Jet::draw(), Artillery::draw(), RocketLauncher::draw(), HeavyTank::draw(), LightTank::draw(), City::draw(), MilitaryUnit::drawBox(), City::drawSelectBox(), BattleEntry::initBattle(), MilitaryUnit::move(), Overhead::overhead_render(), Overhead::overheadRender(), BattleJets::render(), BattleGroup::render(), BattleEntry::render(), BattleEntry::renderBullets(), BattleEntry::renderDebris(), BattleEntry::renderEnvironment(), BattleJets::renderIcon(), renderMainMenu(), renderMultiplayMenu(), renderParticleList(), renderSponsor(), and City::update().

const FLOAT Globals::BATTLE_RADIUS = 100.0f
 

Definition at line 108 of file globals.h.

Referenced by MilitaryUnit::around(), BattleEntry::contains(), and Overhead::overheadRender().

int Globals::currGameTick
 

Definition at line 43 of file Globals.cpp.

Referenced by NetworkData::addData(), Overhead::askForRandomNumbers(), BattleGroup::destroyUnit(), BattleGroup::fire(), NetworkSubsystem::hasNetworkDataForCurrentTickBeenReceived(), BattleEntry::inputIssueGroupCommand(), BattleEntry::inputIssueJetsCommand(), Overhead::overhead_render(), Overhead::overhead_update(), Globals::MessagesReceived::print(), Overhead::processCommand(), NetworkSubsystem::processNetworkData(), Overhead::processOverheadInput(), BattleEntry::processQueuedInput(), NetworkMessages::sendBuildMessage(), Overhead::sendMessageToPrintARandomNumberToTheConsole(), sendReinforcement(), and updateMultiplayMenu().


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