Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
FightTask Class Reference
Inheritance diagram for FightTask:
[legend]
Collaboration diagram for FightTask:
[legend]

Public Member Functions

 FightTask (BoardComputer *boardComputer, const std::vector< Handle< WorldObject >> &targets)
 
virtual void update (float deltaSec)
 
std::vector< Handle
< WorldObject > > & 
targets ()
 
virtual void addTarget (const Handle< WorldObject > &targets)
 
virtual void setTargets (const std::vector< Handle< WorldObject >> &targets)
 
virtual bool isFinished ()
 
- Public Member Functions inherited from AiTask
 AiTask (BoardComputer *boardComputer)
 
BoardComputerboardComputer ()
 
Handle< AiTask > & handle ()
 
- Public Member Functions inherited from Scriptable
int scriptKey () const
 
void setScriptKey (int key)
 
bool isScriptLocal () const
 
void setScriptLocal (bool local)
 

Protected Types

enum  State { IDLE, APPROACH, ENGAGE, EVADE }
 

Protected Member Functions

void updateTargets ()
 
void updateState ()
 
void setState (State newState)
 
glm::vec3 findRandomEvasionPoint ()
 
float targetDistance ()
 
float pointDistance (glm::vec3 point)
 
float angleToTarget ()
 

Protected Attributes

std::vector< Handle
< WorldObject > > 
m_targets
 
WorldObjectm_primaryTarget
 
State m_state
 
bool m_stateChanged
 
float m_maxFireDistance
 
float m_maxRocketDistance
 
float m_minEnemyDistance
 
glm::vec3 m_positionBehindTarget
 
- Protected Attributes inherited from AiTask
Handle< AiTaskm_handle
 
BoardComputerm_boardComputer
 
- Protected Attributes inherited from Scriptable
int m_key
 
bool m_local
 

Additional Inherited Members

- Static Public Attributes inherited from Scriptable
static const int INVALID_KEY = -1
 

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