Advanced Strategic Command
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mine Class Reference

#include <explosivemines.h>

Inheritance diagram for Mine:
Inheritance graph
[legend]

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 More...
 
void paint (Surface &surf, SPoint pos) const
 display the mine More...
 
void read (tnstream &stream)
 
void write (tnstream &stream) const
 

Static Public Member Functions

static Mine newFromStream (tnstream &stream)
 
- Static Public Member Functions inherited from AgeableItem
static bool age (AgeableItem &obj)
 ages the object by one turn. Returns true if the object shall be removed More...
 

Public Attributes

int identifier
 a unique identifier that allows the identification of a single mine More...
 
MineTypes type
 
int strength
 the effective punch of the mine More...
 
int player
 the player who placed the mine; range 0 .. 7 More...
 
- Public Attributes inherited from AgeableItem
int lifetimer
 

Additional Inherited Members

- Protected Member Functions inherited from AgeableItem
 AgeableItem ()
 

Detailed Description

Definition at line 30 of file explosivemines.h.

Constructor & Destructor Documentation

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

Member Function Documentation

bool Mine::attacksunit ( const Vehicle veh) const
Mine Mine::newFromStream ( tnstream stream)
static

Definition at line 113 of file explosivemines.cpp.

References read().

Referenced by RemoveMine::undoAction().

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().

int Mine::player

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

Definition at line 48 of file explosivemines.h.

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

int Mine::strength

the effective punch of the mine

Definition at line 45 of file explosivemines.h.

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

MineTypes Mine::type

The documentation for this class was generated from the following files: