World Class Reference
[Game Data]

Contains all objects in game and manages them. More...

#include <world.h>

Collaboration diagram for World:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 World (void)
 ~World (void)
worldent_iterator getWorldEntitiesBegin ()
 Gets the start of the list of objects.
worldent_iterator getWorldEntitiesEnd ()
 Gets the end of the list of objects.
WorldEntitygetWorldEntity (int id)
 Finds ant returns entity with given ID.
WorldEntitygetWorldEntity (worldent_iterator iterator) const
 Finds ant returns entity with given iterator.
LandscapegetLandscape ()
 Provides access to Landscape.
BonusBoxcreateBonusBox (GLVector3d position, GLQuaterniond orientation, int bonus_function_id)
 Creates new bonus box on the map.
ProjectilecreateProjectile (GLVector3d position, GLQuaterniond orientation, int type_id, int shooter)
 Creates new pojectile in the world.
TankcreateTank (GLVector3d position, GLQuaterniond orientation, int type_id, int player_id)
 Creates new tank in the world.
bool deleteBonusBox (int id, bool delete_bonus)
 Deletes a bonus box from the world.
bool deleteProjectile (int id)
 Deletes a projectile from the world.
bool deleteTank (int id)
 Deletes a tank from the world.

Private Member Functions

int getNextID ()
void addWorldEntity (WorldEntity *we)
void delWorldEntity (WorldEntity *we)
 World (const World &)
 Copy constructor is private, because we don't want anybody to copy that.

Private Attributes

Landscape mLandscape
worldent_list mWorldList
 List of all moveable objects.
worldent_hash mWorldHash
 Hash table of all moveable objects.
int mMaxID
 Maximal unique ID raeched so far.

Friends

class TaskSimulationServer

Detailed Description

Contains all objects in game and manages them.

Class that is owner of Landscape (with its Terrain, Skybox and LandscapeEntities) and WorldEntities. It also manages WorldEntities and provides access to Landscape.

Definition at line 43 of file world.h.


Constructor & Destructor Documentation

World::World void   ) 
 

Definition at line 13 of file world.cpp.

References mMaxID.

World::~World void   ) 
 

Definition at line 18 of file world.cpp.

World::World const World  )  [private]
 

Copy constructor is private, because we don't want anybody to copy that.

Definition at line 279 of file world.cpp.

References DIE().

Here is the call graph for this function:


Member Function Documentation

void World::addWorldEntity WorldEntity we  )  [private]
 

Definition at line 224 of file world.cpp.

References DIE(), CommonEntity::getID(), LOGE, and mWorldHash.

Referenced by createBonusBox(), createProjectile(), and createTank().

Here is the call graph for this function:

BonusBox * World::createBonusBox GLVector3d  position,
GLQuaterniond  orientation,
int  bonus_function_id
 

Creates new bonus box on the map.

Parameters:
position Position on the map where should new object appear.
orientation Orientation of the object on the map, in which it should appear.
bonus_function_id ID of bonus type - its effect
Returns:
Pointer to newly created object, or NULL, if not succesfull.

Definition at line 22 of file world.cpp.

References addWorldEntity(), assertL, CommonEntity::basicInit(), getNextID(), CommonEntity::init(), Bonus::initByID(), BonusBox::initSpecific(), and LOGW.

Here is the call graph for this function:

Projectile * World::createProjectile GLVector3d  position,
GLQuaterniond  orientation,
int  type_id,
int  shooter
 

Creates new pojectile in the world.

Parameters:
position Position on the map where should new object appear.
orientation Orientation of the object on the map, in which it should appear.
type_id ID of projectile type
shooter ID of player who shot this projectile
Returns:
Pointer to newly created object, or NULL, if not succesfull.

Definition at line 47 of file world.cpp.

References addWorldEntity(), assertL, gApp, Application::getGameCommon(), getNextID(), Game::isPlayerIDValid(), and LOGW.

Here is the call graph for this function:

Tank * World::createTank GLVector3d  position,
GLQuaterniond  orientation,
int  type_id,
int  player_id
 

Creates new tank in the world.

Parameters:
position Position on the map where should new object appear.
orientation Orientation of the object on the map, in which it should appear.
type_id ID of tank type
player_id ID of player who controls this tank
Returns:
Pointer to newly created object, or NULL, if not succesfull.

Definition at line 70 of file world.cpp.

References addWorldEntity(), assertL, gApp, Application::getGameCommon(), getNextID(), Game::isPlayerIDValid(), and LOGW.

Referenced by TaskSimulationServer::tick().

Here is the call graph for this function:

bool World::deleteBonusBox int  id,
bool  delete_bonus
 

Deletes a bonus box from the world.

Parameters:
id ID of object to delete.
delete_bonus Tells, whether the method has to delete bonus's effect class, too.
Returns:
True if successfull.

Definition at line 93 of file world.cpp.

References cBonusBox, CommonEntity::getClassType(), getWorldEntity(), and LOGW.

Here is the call graph for this function:

bool World::deleteProjectile int  id  ) 
 

Deletes a projectile from the world.

Parameters:
id ID of object to delete.
Returns:
True if successfull.

Definition at line 128 of file world.cpp.

References cProjectile, delWorldEntity(), CommonEntity::getClassType(), getWorldEntity(), and LOGW.

Here is the call graph for this function:

bool World::deleteTank int  id  ) 
 

Deletes a tank from the world.

Parameters:
id ID of object to delete.
Returns:
True if successfull.

Definition at line 153 of file world.cpp.

References cTank, delWorldEntity(), CommonEntity::getClassType(), getWorldEntity(), and LOGW.

Here is the call graph for this function:

void World::delWorldEntity WorldEntity we  )  [private]
 

Definition at line 250 of file world.cpp.

References DIE(), CommonEntity::getID(), LOGE, and mWorldHash.

Referenced by deleteProjectile(), and deleteTank().

Here is the call graph for this function:

Landscape & World::getLandscape  ) 
 

Provides access to Landscape.

Definition at line 219 of file world.cpp.

References mLandscape.

Referenced by TaskSimulationServer::checkTerrainHeights(), TaskRender::init(), LayerGame::initRefs(), GameServer::run(), and GameClient::run().

int World::getNextID  )  [private]
 

Return next unique ID in world. Allways return positive number

Definition at line 274 of file world.cpp.

Referenced by createBonusBox(), createProjectile(), and createTank().

worldent_iterator World::getWorldEntitiesBegin  ) 
 

Gets the start of the list of objects.

Definition at line 178 of file world.cpp.

References mWorldList.

Referenced by TaskSimulationServer::checkTerrainHeights(), LayerGame::renderWorldEntities(), TaskSimulationServer::setCollModelTransformations(), and TaskSimulationServer::updateHistory().

worldent_iterator World::getWorldEntitiesEnd  ) 
 

Gets the end of the list of objects.

Definition at line 183 of file world.cpp.

References mWorldList.

Referenced by TaskSimulationServer::checkTerrainHeights(), LayerGame::renderWorldEntities(), TaskSimulationServer::setCollModelTransformations(), and TaskSimulationServer::updateHistory().

WorldEntity * World::getWorldEntity worldent_iterator  iterator  )  const
 

Finds ant returns entity with given iterator.

Parameters:
iterator Iterator to list of objects.
Returns:
Pointer to the found object, or NULL if the iterator was equal to end().

Definition at line 206 of file world.cpp.

References DIE(), LOGE, and mWorldList.

Here is the call graph for this function:

WorldEntity * World::getWorldEntity int  id  ) 
 

Finds ant returns entity with given ID.

Parameters:
id ID of wanted object
Returns:
Pointer to the found object, or NULL if doesn't exists object with that ID

Definition at line 188 of file world.cpp.

References DIE(), LOGD, LOGE, and mWorldHash.

Referenced by deleteBonusBox(), deleteProjectile(), deleteTank(), and LayerGame::renderWorldEntities().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class TaskSimulationServer [friend]
 

Definition at line 136 of file world.h.


Member Data Documentation

Landscape World::mLandscape [private]
 

Definition at line 150 of file world.h.

Referenced by getLandscape().

int World::mMaxID [private]
 

Maximal unique ID raeched so far.

Definition at line 156 of file world.h.

Referenced by World().

worldent_hash World::mWorldHash [private]
 

Hash table of all moveable objects.

Definition at line 154 of file world.h.

Referenced by addWorldEntity(), delWorldEntity(), and getWorldEntity().

worldent_list World::mWorldList [private]
 

List of all moveable objects.

Definition at line 153 of file world.h.

Referenced by getWorldEntitiesBegin(), getWorldEntitiesEnd(), and getWorldEntity().


The documentation for this class was generated from the following files:
Generated on Wed Apr 12 14:48:01 2006 for bjs by  doxygen 1.4.5