Mine Class Reference

#include <explosivemines.h>

Inheritance diagram for Mine:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Mine (MineTypes type, int strength, int player, GameMap *gamemap)
 Mine (MineTypes type, int strength, int player, GameMap *gamemap, int identifier)
bool attacksunit (const Vehicle *veh) const
 can the mine attack this unit
void paint (Surface &surf, SPoint pos) const
 display the mine
void read (tnstream &stream)
void write (tnstream &stream) const

Static Public Member Functions

static Mine newFromStream (tnstream &stream)

Public Attributes

int identifier
 a unique identifier that allows the identification of a single mine
MineTypes type
int strength
 the effective punch of the mine
int player
 the player who placed the mine; range 0 .. 7

Detailed Description

Definition at line 30 of file explosivemines.h.


Constructor & Destructor Documentation

Mine::Mine ( MineTypes  type,
int  strength,
int  player,
GameMap gamemap 
)

Definition at line 65 of file explosivemines.cpp.

References cgp_antipersonnelmine_lifetime, GameMap::getgameparameter(), GameMap::IDManager::getNewNetworkID(), identifier, GameMap::idManager, and AgeableItem::lifetimer.

Mine::Mine ( MineTypes  type,
int  strength,
int  player,
GameMap gamemap,
int  identifier 
)

Definition at line 76 of file explosivemines.cpp.

References cgp_antipersonnelmine_lifetime, GameMap::getgameparameter(), and AgeableItem::lifetimer.


Member Function Documentation

Mine Mine::newFromStream ( tnstream stream  )  [static]

Definition at line 113 of file explosivemines.cpp.

References read().

Referenced by RemoveMine::undoAction().

bool Mine::attacksunit ( const Vehicle veh  )  const

can the mine attack this unit

Definition at line 40 of file explosivemines.cpp.

References chfahrend, chgetaucht, chschwimmend, cmantipersonnelmine, cmantitankmine, cmfloatmine, cmm_trooper, cmmooredmine, Player::diplomacy, ContainerBase::getMap(), ContainerBase::getOwner(), GameMap::getPlayer(), DiplomaticStateVector::getState(), ContainerBaseType::hasFunction(), Vehicle::height, ContainerBaseType::ImmuneToMines, VehicleType::movemalustyp, PEACE, player, Vehicle::typ, and type.

void Mine::paint ( Surface surf,
SPoint  pos 
) const

display the mine

Definition at line 58 of file explosivemines.cpp.

References MineType::paint(), player, and type.

Referenced by GetAttackerImage::visit().

void Mine::read ( tnstream stream  ) 

Definition at line 88 of file explosivemines.cpp.

References identifier, mineVersion, player, tnstream::readInt(), strength, and type.

Referenced by newFromStream().

void Mine::write ( tnstream stream  )  const

Definition at line 100 of file explosivemines.cpp.

References identifier, mineVersion, player, strength, type, and tnstream::writeInt().


Member Data Documentation

int Mine::identifier

a unique identifier that allows the identification of a single mine

Definition at line 40 of file explosivemines.h.

Referenced by Mine(), read(), and write().

MineTypes Mine::type

Definition at line 42 of file explosivemines.h.

Referenced by attacksunit(), paint(), read(), tspfldloaders::readfields(), tmineattacksunit::setup(), and write().

int Mine::strength

the effective punch of the mine

Definition at line 45 of file explosivemines.h.

Referenced by read(), tmineattacksunit::setup(), and write().

int Mine::player

the player who placed the mine; range 0 .. 7

Definition at line 48 of file explosivemines.h.

Referenced by attacksunit(), paint(), read(), and write().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:03 2012 for Advanced Strategic Command by  doxygen 1.5.1