Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Vehicle::ReactionFire Class Reference

The class that manages the reaction fire which causes a unit to attack approaching enemies even if it is not the unit's turn. More...

#include <vehicle.h>

List of all members.

Public Types

enum  Status {
  off, init1a, init2, ready,
  init1b
}

Public Member Functions

 ReactionFire (Vehicle *_unit)
Status getStatus () const
 for each player that can still be attacked one bit is set
int enable ()
 enables the reaction fire or returns an error code ( result < 0 = -errorNr )
void disable ()
void endOwnTurn ()
 hook that is called when a turn ends
void endAnyTurn ()
void checkData ()
bool canPerformAttack (Vehicle *target)
bool canMove () const

Public Attributes

vector< int > weaponShots
vector< int > nonattackableUnits

Friends

class Vehicle
class UnitPropertyEditor


Detailed Description

The class that manages the reaction fire which causes a unit to attack approaching enemies even if it is not the unit's turn.

Definition at line 120 of file vehicle.h.


Member Enumeration Documentation

enum Vehicle::ReactionFire::Status
 

Enumeration values:
off 
init1a 
init2 
ready 
init1b 

Definition at line 127 of file vehicle.h.


Constructor & Destructor Documentation

Vehicle::ReactionFire::ReactionFire Vehicle _unit  ) 
 

Definition at line 626 of file vehicle.cpp.

References UnitWeapon::count, Vehicle::typ, Vehicletype::weapons, and weaponShots.


Member Function Documentation

bool Vehicle::ReactionFire::canMove  )  const
 

Definition at line 719 of file vehicle.cpp.

References ContainerBaseType::hasFunction(), ContainerBaseType::MoveWithReactionFire, off, and Vehicle::typ.

Referenced by Vehicle::canMove(), Vehicle::getHeightChange(), and Vehicle::getMovement().

bool Vehicle::ReactionFire::canPerformAttack Vehicle target  ) 
 

Definition at line 728 of file vehicle.cpp.

References GameMap::actplayer, ContainerBase::getCarrier(), ContainerBase::getMap(), getStatus(), nonattackableUnits, and ready.

void Vehicle::ReactionFire::checkData  ) 
 

Definition at line 633 of file vehicle.cpp.

References UnitWeapon::count, SingleWeapon::reactionFireShots, Vehicle::typ, UnitWeapon::weapon, Vehicletype::weapons, and weaponShots.

void Vehicle::ReactionFire::disable  ) 
 

Definition at line 691 of file vehicle.cpp.

References ContainerBaseType::hasFunction(), init1a, init2, ContainerBaseType::MoveWithReactionFire, off, Vehicle::setMovement(), and Vehicle::typ.

Referenced by copyVehicleData(), and UnitPropertyEditor::init().

int Vehicle::ReactionFire::enable  ) 
 

enables the reaction fire or returns an error code ( result < 0 = -errorNr )

Definition at line 654 of file vehicle.cpp.

References UnitWeapon::count, ContainerBaseType::hasFunction(), Vehicle::height, init2, ContainerBaseType::NoReactionfire, off, ready, SingleWeapon::shootable(), SingleWeapon::sourceheight, Vehicle::typ, Vehicletype::wait, UnitWeapon::weapon, and Vehicletype::weapons.

Referenced by copyVehicleData().

void Vehicle::ReactionFire::endAnyTurn  ) 
 

Definition at line 701 of file vehicle.cpp.

Referenced by Vehicle::endAnyTurn().

void Vehicle::ReactionFire::endOwnTurn  ) 
 

hook that is called when a turn ends

Definition at line 707 of file vehicle.cpp.

References init1a, init1b, init2, nonattackableUnits, off, and ready.

Referenced by Vehicle::endOwnTurn().

Status Vehicle::ReactionFire::getStatus void   )  const [inline]
 

for each player that can still be attacked one bit is set

Definition at line 131 of file vehicle.h.

Referenced by attackpossible2n(), ServiceTargetSearcher::available(), canPerformAttack(), copyVehicleData(), UnitPropertyEditor::init(), and Vehicle::postAttack().


Friends And Related Function Documentation

friend class UnitPropertyEditor [friend]
 

Definition at line 122 of file vehicle.h.

friend class Vehicle [friend]
 

Definition at line 121 of file vehicle.h.


Member Data Documentation

vector<int> Vehicle::ReactionFire::nonattackableUnits
 

Definition at line 138 of file vehicle.h.

Referenced by canPerformAttack(), endOwnTurn(), tunitattacksunit::setresult(), and Vehicle::write().

vector<int> Vehicle::ReactionFire::weaponShots
 

Definition at line 137 of file vehicle.h.

Referenced by checkData(), ReactionFire(), tunitattacksunit::setresult(), and Vehicle::write().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:22:14 2008 for Advanced Strategic Command by  doxygen 1.4.2