tunitattacksobject Class Reference

#include <attack.h>

Inheritance diagram for tunitattacksobject:

Inheritance graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

Definition at line 251 of file attack.h.


Constructor & Destructor Documentation

tunitattacksobject::tunitattacksobject ( Vehicle attackingunit,
int  obj_x,
int  obj_y,
int  weapon = -1 
)

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

Parameters:
attackingunit the attacking unit
obj_x the X coordinate of the object on the map
obj_y the Y coordinate of the object on the map
weapon The number of the weapon which the attacking unit attacks with. If it is -1, the best weapon is chosen.

Definition at line 654 of file attack.cpp.

References setup().


Member Function Documentation

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

Reimplemented from UnitAttacksSomething.

Definition at line 258 of file attack.h.

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

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

Implements tfight.

Definition at line 262 of file attack.h.

void tunitattacksobject::setup ( Vehicle attackingunit,
int  obj_x,
int  obj_y,
int  weapon 
)

Definition at line 660 of file attack.cpp.

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

Referenced by tunitattacksobject().

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

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

Implements tfight.

Definition at line 742 of file attack.cpp.

References UnitAttacksSomething::_attackingunit, Vehicle::ammo, tfight::av, ActionRegistry::ChangeObjectProperty, ActionRegistry::ConsumeAmmo, ChangeObjectProperty::Damage, ContainerBase::damage, tfight::tavalues::damage, tfight::dv, GameAction::execute(), ContainerBase::getMap(), SingleWeapon::getScalarWeaponType(), ObjectType::id, ActionRegistry::InflictDamage, Vehicle::postAttack(), ActionRegistry::RemoveObject, Object::typ, Vehicle::typ, tfight::tavalues::weapcount, tfight::tavalues::weapnum, UnitWeapon::weapon, and VehicleType::weapons.

Referenced by trunreplay::execnextreplaymove().

Object* tunitattacksobject::getTarget (  )  [inline]

Definition at line 277 of file attack.h.

Referenced by GetTargetImage::visit().

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

Implements tfight.

Definition at line 281 of file attack.h.

References FightVisitor::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