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
class ChangeUnitProperty


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 126 of file vehicle.h.


Member Enumeration Documentation

enum Vehicle::ReactionFire::Status

Enumerator:
off 
init1a 
init2 
ready 
init1b 

Definition at line 134 of file vehicle.h.


Constructor & Destructor Documentation

Vehicle::ReactionFire::ReactionFire ( Vehicle _unit  ) 

Definition at line 558 of file vehicle.cpp.

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


Member Function Documentation

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

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

Definition at line 138 of file vehicle.h.

Referenced by attackpossible2n(), ReactionFireSwitchCommand::avail(), JumpDriveCommand::available(), RepairUnitCommand::availExternally(), canPerformAttack(), copyVehicleData(), ServiceTargetSearcher::externallyAvailable(), ReactionFireSwitchCommand::go(), UnitPropertyEditor::init(), ReactionFireLayer::paintSingleField(), Vehicle::postAttack(), and AttackCommand::searchTargets().

int Vehicle::ReactionFire::enable (  ) 

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

Deprecated:

Definition at line 586 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(), trunreplay::execnextreplaymove(), and setReactionFire().

void Vehicle::ReactionFire::disable (  ) 

Deprecated:

Definition at line 623 of file vehicle.cpp.

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

Referenced by copyVehicleData(), trunreplay::execnextreplaymove(), UnitPropertyEditor::init(), and setReactionFire().

void Vehicle::ReactionFire::endOwnTurn (  ) 

hook that is called when a turn ends

Definition at line 639 of file vehicle.cpp.

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

Referenced by Vehicle::endOwnTurn().

void Vehicle::ReactionFire::endAnyTurn (  ) 

Definition at line 633 of file vehicle.cpp.

Referenced by Vehicle::endAnyTurn().

void Vehicle::ReactionFire::checkData (  ) 

Definition at line 565 of file vehicle.cpp.

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

bool Vehicle::ReactionFire::canPerformAttack ( Vehicle target  ) 

Definition at line 660 of file vehicle.cpp.

References Player::diplomacy, ContainerBase::getCarrier(), ContainerBase::getMap(), ContainerBase::getOwner(), GameMap::getPlayer(), getStatus(), DiplomaticStateVector::isHostile(), Vehicle::networkid, nonattackableUnits, and ready.

Referenced by tsearchreactionfireingunits::attack().

bool Vehicle::ReactionFire::canMove (  )  const

Definition at line 651 of file vehicle.cpp.

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

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


Friends And Related Function Documentation

friend class Vehicle [friend]

Definition at line 127 of file vehicle.h.

friend class UnitPropertyEditor [friend]

Definition at line 128 of file vehicle.h.

friend class ChangeUnitProperty [friend]

Definition at line 129 of file vehicle.h.


Member Data Documentation

vector<int> Vehicle::ReactionFire::weaponShots

Definition at line 148 of file vehicle.h.

Referenced by checkData(), ReactionFire(), RegisterUnitRFTarget::runAction(), RegisterUnitRFTarget::undoAction(), and Vehicle::write().

vector<int> Vehicle::ReactionFire::nonattackableUnits

Definition at line 149 of file vehicle.h.

Referenced by canPerformAttack(), endOwnTurn(), RegisterUnitRFTarget::runAction(), RegisterUnitRFTarget::undoAction(), and Vehicle::write().


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