tunitattacksbuilding Class Reference

#include <attack.h>

Inheritance diagram for tunitattacksbuilding:

Inheritance graph
[legend]
List of all members.

Public Member Functions

int getAttackingPlayer ()
int getDefendingPlayer ()
 tunitattacksbuilding (Vehicle *attackingunit, int x, int y, int weapon=-1)
void setup (Vehicle *attackingunit, int x, int y, int weapon)
void setresult (const Context &context)
 Writes the result of the attack calculation to the actual units.
void visit (FightVisitor &visitor)
BuildinggetTarget ()

Detailed Description

Definition at line 177 of file attack.h.


Constructor & Destructor Documentation

tunitattacksbuilding::tunitattacksbuilding ( Vehicle attackingunit,
int  x,
int  y,
int  weapon = -1 
)

Calculates the fight if one unit attacks the building at coordinate x/y.

Parameters:
weapon The number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen.

Definition at line 439 of file attack.cpp.

References setup().


Member Function Documentation

int tunitattacksbuilding::getAttackingPlayer (  )  [inline, virtual]

Reimplemented from UnitAttacksSomething.

Definition at line 182 of file attack.h.

References UnitAttacksSomething::_attackingunit, and ContainerBase::getOwner().

int tunitattacksbuilding::getDefendingPlayer (  )  [inline, virtual]

Implements tfight.

Definition at line 186 of file attack.h.

References ContainerBase::getOwner().

void tunitattacksbuilding::setup ( Vehicle attackingunit,
int  x,
int  y,
int  weapon 
)

Definition at line 446 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, attackpossible(), beeline(), AttackWeap::count, tfight::dist, GameMap::getField(), ContainerBase::getMap(), AttackWeap::num, AttackWeap::strength, Vehicle::xpos, and Vehicle::ypos.

Referenced by tunitattacksbuilding().

void tunitattacksbuilding::setresult ( const Context context  )  [virtual]

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

Implements tfight.

Definition at line 524 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::av, ActionRegistry::ConsumeAmmo, ContainerBase::damage, tfight::tavalues::damage, tfight::dv, GameAction::execute(), Building::getPosition(), SingleWeapon::getScalarWeaponType(), ActionRegistry::InflictDamage, Vehicle::postAttack(), Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, and VehicleType::weapons.

Referenced by trunreplay::execnextreplaymove().

void tunitattacksbuilding::visit ( FightVisitor visitor  )  [inline, virtual]

Implements tfight.

Definition at line 198 of file attack.h.

References FightVisitor::visit().

Building* tunitattacksbuilding::getTarget (  )  [inline]

Definition at line 202 of file attack.h.

Referenced by GetTargetImage::visit().


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