Advanced Strategic Command
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
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>

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 More...
 
int enable ()
 enables the reaction fire or returns an error code ( result < 0 = -errorNr ) More...
 
void disable ()
 
void endOwnTurn ()
 hook that is called when a turn ends More...
 
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 143 of file vehicle.h.

Member Enumeration Documentation

Enumerator
off 
init1a 
init2 
ready 
init1b 

Definition at line 151 of file vehicle.h.

Constructor & Destructor Documentation

Vehicle::ReactionFire::ReactionFire ( Vehicle _unit)

Definition at line 661 of file vehicle.cpp.

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

Member Function Documentation

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

Definition at line 763 of file vehicle.cpp.

References ContainerBase::getOwner(), and Vehicle::networkid.

Referenced by tsearchreactionfireingunits::attack().

void Vehicle::ReactionFire::checkData ( )

Definition at line 668 of file vehicle.cpp.

void Vehicle::ReactionFire::disable ( void  )
int Vehicle::ReactionFire::enable ( void  )

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

Deprecated:

Definition at line 689 of file vehicle.cpp.

References ContainerBaseType::NoReactionfire.

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

void Vehicle::ReactionFire::endAnyTurn ( void  )

Definition at line 736 of file vehicle.cpp.

Referenced by Vehicle::endAnyTurn().

void Vehicle::ReactionFire::endOwnTurn ( void  )

hook that is called when a turn ends

Definition at line 742 of file vehicle.cpp.

Referenced by Vehicle::endOwnTurn().

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

Friends And Related Function Documentation

friend class ChangeUnitProperty
friend

Definition at line 146 of file vehicle.h.

friend class UnitPropertyEditor
friend

Definition at line 145 of file vehicle.h.

friend class Vehicle
friend

Definition at line 144 of file vehicle.h.

Member Data Documentation

vector<int> Vehicle::ReactionFire::nonattackableUnits
vector<int> Vehicle::ReactionFire::weaponShots

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