Advanced Strategic Command
Public Member Functions | List of all members
tmineattacksunit Class Reference

#include <attack.h>

Inheritance diagram for tmineattacksunit:
Inheritance graph
[legend]

Public Member Functions

int getAttackingPlayer ()
 
int getDefendingPlayer ()
 
 tmineattacksunit (const MapCoordinate &mineposition, int minenum, Vehicle *&attackedunit)
 
void setup (const MapCoordinate &position, int minenum, Vehicle *&attackedunit)
 
void setresult (const Context &context)
 Writes the result of the attack calculation to the actual units. More...
 
MinegetFirstMine ()
 
void visit (FightVisitor &visitor)
 
VehiclegetTarget ()
 
- Public Member Functions inherited from tfight
void calc (void)
 Performs the calculation of the attack. The result is only stored in the av and dv structures and is not written to the map. More...
 
- Public Member Functions inherited from AttackFormula
 AttackFormula (GameMap *gamemap)
 
float strength_experience (int experience)
 
float strength_damage (int damage)
 
float strength_attackbonus (int abonus)
 
float strength_hemming (int ax, int ay, Vehicle *d_eht)
 
float defense_experience (int experience)
 
float defense_defensebonus (int defensebonus)
 
int getIconIndex (int experience, bool offensive)
 
virtual ~AttackFormula ()
 

Additional Inherited Members

- Static Public Member Functions inherited from AttackFormula
static float getHemmingFactor (int relDir)
 
- Public Attributes inherited from tfight
struct tfight::tavalues av
 
struct tfight::tavalues dv
 
- Static Public Attributes inherited from AttackFormula
static const int experienceIcons = 24
 
- Protected Member Functions inherited from tfight
 tfight (GameMap *gamemap)
 
- Protected Attributes inherited from tfight
int dist
 
- Protected Attributes inherited from AttackFormula
GameMapgamemap
 

Detailed Description

Definition at line 212 of file attack.h.

Constructor & Destructor Documentation

tmineattacksunit::tmineattacksunit ( const MapCoordinate mineposition,
int  minenum,
Vehicle *&  attackedunit 
)

Calculates the fight if a unit drives onto a mine.

Parameters
minepositionThe field on which the mine was placed
minenumThe number of a specific mine which explodes. If -1 , all mines on this field which are able to attack the unit will explode.
attackedunitThe unit which moved onto the minefield.

Definition at line 612 of file attack.cpp.

References setup().

Member Function Documentation

int tmineattacksunit::getAttackingPlayer ( )
inlinevirtual

Implements tfight.

Definition at line 222 of file attack.h.

int tmineattacksunit::getDefendingPlayer ( )
inlinevirtual

Implements tfight.

Definition at line 226 of file attack.h.

References ContainerBase::getOwner().

Mine * tmineattacksunit::getFirstMine ( )

Definition at line 716 of file attack.cpp.

References MapField::mines.

Referenced by GetAttackerImage::visit().

Vehicle* tmineattacksunit::getTarget ( )
inline

Definition at line 248 of file attack.h.

Referenced by GetTargetImage::visit(), and BattleSoundPlayer::visit().

void tmineattacksunit::setresult ( const Context context)
virtual

Writes the result of the attack calculation to the actual units.

Implements tfight.

Definition at line 693 of file attack.cpp.

References tfight::tavalues::damage, ContainerBase::damage, tfight::dv, ContainerBase::getMap(), ActionRegistry::InflictDamage, MapField::mines, and ActionRegistry::RemoveMine.

Referenced by MoveUnit::runAction().

void tmineattacksunit::setup ( const MapCoordinate position,
int  minenum,
Vehicle *&  attackedunit 
)
void tmineattacksunit::visit ( FightVisitor visitor)
inlinevirtual

Implements tfight.

Definition at line 243 of file attack.h.

References FightVisitor::visit().


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