Tank Class Reference
[Game Data]

Representation of tank. More...

#include <tank.h>

Inherits WorldEntity.

Inheritance diagram for Tank:

Inheritance graph
[legend]
Collaboration diagram for Tank:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Tank ()
 ~Tank ()
virtual void createPresentPoint (int time_stamp)
 Overloaded creation of present history point from WorldEntity.
virtual void render ()
void initByID (int params_ID)
 Initializes Tank according to its ID in params.
bool initSpecific (int player_id)
 Inits mPlayer field.

Private Attributes

int mHP
 Current HPs of tank.
int mArmour
 Current armour per cents of tank.
int mMaxHP
 Maximum of HPs.
int mMaxArmour
 Maximum of armour per cents (cannot be more than 100 :-)).
double mMaxSpeed
 The top speed taht can the tank achieve.
int mWeight
 Weight of the tank in kgs.
int mEnginePower
 Power of engine in Watts.
double mTurnAngle
 Ability of the tank to turn - in radians.
PlayermPlayer
 Player who controlls this tank.
double mPitch
 Pitch of the tank's weapon.
double mYaw
 Yaw of the tank's weapon.

Detailed Description

Representation of tank.

Definition at line 27 of file tank.h.


Constructor & Destructor Documentation

Tank::Tank  ) 
 

Definition at line 9 of file tank.cpp.

References cTank, and CommonEntity::mType.

Tank::~Tank  ) 
 

Definition at line 15 of file tank.cpp.


Member Function Documentation

void Tank::createPresentPoint int  time_stamp  )  [virtual]
 

Overloaded creation of present history point from WorldEntity.

Parameters:
time_stamp What is the time stamp of point created

Reimplemented from WorldEntity.

Definition at line 49 of file tank.cpp.

References CommonEntity::mID, HistoryPoint::mID, CommonEntity::mOrientation, HistoryPoint::mOrientation, mPitch, TanksHistoryPoint::mPitch, CommonEntity::mPosition, HistoryPoint::mPosition, WorldEntity::mPresentPoint, WorldEntity::mSpeed, HistoryPoint::mSpeed, HistoryPoint::mTimeStamp, mYaw, and TanksHistoryPoint::mYaw.

void Tank::initByID int  params_ID  ) 
 

Initializes Tank according to its ID in params.

Parameters:
params_ID ID from Params to initialize by.

Definition at line 20 of file tank.cpp.

References Params::sTankParams::armor, assertL, Params::sTankParams::engine_power, gParams, Params::sTankParams::hp, Params::sTankParams::id, mArmour, Params::sTankParams::max_speed, mEnginePower, mHP, mMaxArmour, mMaxHP, mMaxSpeed, CommonEntity::mSubType, mTurnAngle, mWeight, Params::tank(), Params::sTankParams::turning, and Params::sTankParams::weight.

Here is the call graph for this function:

bool Tank::initSpecific int  player_id  ) 
 

Inits mPlayer field.

Parameters:
player_id ID of player that will control this tank
Returns:
true, if initialisation successfull, false otherwise

Definition at line 41 of file tank.cpp.

References gApp, Application::getGameCommon(), Game::getPlayer(), mPitch, mPlayer, and mYaw.

Here is the call graph for this function:

void Tank::render  )  [virtual]
 

Reimplemented from CommonEntity.

Definition at line 48 of file tank_client.cpp.

References BOTTOM_BACK_RIGHT, CollisionModel::getModel(), glDrawCube(), CommonEntity::mColModel, CommonEntity::mOrientation, CommonEntity::mPosition, CDBox::mVertex, and TOP_FRONT_LEFT.

Here is the call graph for this function:


Member Data Documentation

int Tank::mArmour [private]
 

Current armour per cents of tank.

Definition at line 56 of file tank.h.

Referenced by initByID().

int Tank::mEnginePower [private]
 

Power of engine in Watts.

Definition at line 62 of file tank.h.

Referenced by initByID().

int Tank::mHP [private]
 

Current HPs of tank.

Definition at line 55 of file tank.h.

Referenced by initByID().

int Tank::mMaxArmour [private]
 

Maximum of armour per cents (cannot be more than 100 :-)).

Definition at line 59 of file tank.h.

Referenced by initByID().

int Tank::mMaxHP [private]
 

Maximum of HPs.

Definition at line 58 of file tank.h.

Referenced by initByID().

double Tank::mMaxSpeed [private]
 

The top speed taht can the tank achieve.

Definition at line 60 of file tank.h.

Referenced by initByID().

double Tank::mPitch [private]
 

Pitch of the tank's weapon.

Definition at line 68 of file tank.h.

Referenced by createPresentPoint(), and initSpecific().

Player* Tank::mPlayer [private]
 

Player who controlls this tank.

Definition at line 65 of file tank.h.

Referenced by initSpecific().

double Tank::mTurnAngle [private]
 

Ability of the tank to turn - in radians.

Definition at line 63 of file tank.h.

Referenced by initByID().

int Tank::mWeight [private]
 

Weight of the tank in kgs.

Reimplemented from WorldEntity.

Definition at line 61 of file tank.h.

Referenced by initByID().

double Tank::mYaw [private]
 

Yaw of the tank's weapon.

Definition at line 69 of file tank.h.

Referenced by createPresentPoint(), and initSpecific().


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