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

#include <attack.h>

Inheritance diagram for tunitattacksunit:
Inheritance graph
[legend]

Public Member Functions

 tunitattacksunit (Vehicle *&attackingunit, Vehicle *&attackedunit, bool respond=true, int weapon=-1, bool reactionfire=false)
 
void setup (Vehicle *&attackingunit, Vehicle *&attackedunit, bool respond, int weapon)
 
void setresult (const Context &context)
 Writes the result of the attack calculation to the actual units. More...
 
void visit (FightVisitor &visitor)
 
VehiclegetTarget ()
 
int getDefendingPlayer ()
 
- Public Member Functions inherited from UnitAttacksSomething
VehiclegetAttackingUnit ()
 
- 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 UnitAttacksSomething
 UnitAttacksSomething (GameMap *gamemap)
 
int getAttackingPlayer ()
 
- Protected Member Functions inherited from tfight
 tfight (GameMap *gamemap)
 
- Protected Attributes inherited from UnitAttacksSomething
Vehicle_attackingunit
 
- Protected Attributes inherited from tfight
int dist
 
- Protected Attributes inherited from AttackFormula
GameMapgamemap
 

Detailed Description

Definition at line 143 of file attack.h.

Constructor & Destructor Documentation

tunitattacksunit::tunitattacksunit ( Vehicle *&  attackingunit,
Vehicle *&  attackedunit,
bool  respond = true,
int  weapon = -1,
bool  reactionfire = false 
)

Calculates the fight if one unit attacks another units.

Parameters
respondDoes the unit that is being attacked retalliate ?
weaponThe number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen.

Definition at line 279 of file attack.cpp.

References setup().

Member Function Documentation

int tunitattacksunit::getDefendingPlayer ( )
inlinevirtual

Implements tfight.

Definition at line 173 of file attack.h.

References ContainerBase::getOwner().

Vehicle* tunitattacksunit::getTarget ( )
inline

Definition at line 168 of file attack.h.

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

void tunitattacksunit::setresult ( const Context context)
virtual
void tunitattacksunit::setup ( Vehicle *&  attackingunit,
Vehicle *&  attackedunit,
bool  respond,
int  weapon 
)
void tunitattacksunit::visit ( FightVisitor visitor)
inlinevirtual

Implements tfight.

Definition at line 164 of file attack.h.

References FightVisitor::visit().


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