Inherited by Classes.CFieldOps, Classes.CMedic, and Classes.CSoldier.
Inheritance diagram for Classes.CTroop:
Static Public Attributes | |
static final int | ARG_TEAM = 0 |
static final int | TEAM_NONE = 0 |
static final int | TEAM_ALLIED = 100 |
static final int | TEAM_AXIS = 200 |
static final int | CLASS_NONE = 0 |
static final int | CLASS_SOLDIER = 1 |
static final int | CLASS_MEDIC = 2 |
static final int | CLASS_ENGINEER = 3 |
static final int | CLASS_FIELDOPS = 4 |
Protected Member Functions | |
void | setup () |
'setup' method of jade agents. | |
void | takeDown () |
'takeDown' method of jade agents. | |
final int | Move () |
final int | GetHealth () |
Get the current health of the agent. | |
final int | GetAmmo () |
Get the current ammunition of the agent. | |
final int | GetStamina () |
Get the current stamina of the agent. | |
final void | UseStamina () |
Use stamina from the stamina bar if possible (there is at least 5 units). | |
final int | GetPower () |
Get the current power of the agent. | |
final void | UsePower () |
Use power from the power bar if possible (there is at least 25 units). | |
final void | AddServiceType (String _sServiceType) |
Adds a type of service to the service type list. | |
final boolean | CheckStaticPosition () |
Checks our position on the static map. | |
final boolean | CheckStaticPosition (double _x, double _z) |
Checks a position on the static map. | |
final void | AddTask (int _tTypeOfTask, AID _Owner, String _sContent) |
Adds a task to the task list. | |
final void | AddTask (int _tTypeOfTask, AID _Owner, String _sContent, int _iPriority) |
Adds a task to the task list with a modified priority. | |
final void | Look () |
The agent looks in the direction he is walking. | |
final boolean | Shot (int _iShotNum) |
The agent shoots in the direction he is aiming. | |
final void | PerformAimAction () |
Action to do when agent has an enemy at sight. | |
final boolean | HaveAgentToShot () |
To know if an enemy is aimed. | |
final int | GetTeamFromAgentInSight (int _eType) |
To know the team of an enemy in sight. | |
final int | GetClassFromAgentInSight (int _eType) |
To know the class of an enemy in sight. | |
void | CallForMedic () |
Request for medicine. | |
void | CallForAmmo () |
Request for ammunition. | |
void | CallForBackup () |
Request for backup. | |
void | UpdateTargets () |
Update priority of all 'prepared (to execute)' tasks. | |
boolean | ShouldUpdateTargets () |
Should we update now all 'prepared (to execute)' tasks? | |
void | ObjectivePackTaken () |
The agent has got the objective pack. | |
void | SetUpPriorities () |
Definition of priorities for each kind of task. | |
void | PerformNoAmmoAction () |
Action to do if this agent cannot shoot. | |
void | PerformTargetReached (CTask _CurrentTask) |
Action to do when this agent reaches the target of current task. | |
void | GenerateEscapePosition () |
Calculates a new destiny position to escape. | |
boolean | GeneratePath () |
Calculates a new destiny position to walk. | |
void | CreateControlPoints () |
Calculates an array of positions for patrolling. | |
void | PerformEscapeAction () |
Action to do when the agent tries to escape. | |
boolean | GetAgentToAim () |
Calculates if there is an enemy at sight. | |
void | PerformLookAction () |
Action to do when the agent is looking at. | |
Protected Attributes | |
AID | m_Manager = null |
Variable used to store the AID of Manager. | |
Hashtable | m_TaskList |
List of prepared to execut tasks. | |
CTask | m_CurrentTask |
Variable used to point the current task in execution. | |
boolean | m_bObjectiveCarried |
Variable indicating if this agent is carrying the objective pack (flag). | |
int | m_TaskPriority [] |
Array of default values of priorities for each task. | |
Vector3D | m_ControlPoints [] |
Array of points used in patrolling task. | |
int | m_iControlPointsIndex |
Current position in array m_ControlPoints. | |
Vector3D | m_AStarPath [] |
Array of points used in walking (a calculated) path task. | |
int | m_iAStarPathIndex |
Current position in array m_AStarPath. | |
ArrayList | m_FOVObjects |
List of objects in the agent's Field Of Vision. | |
CSight | m_AimedAgent |
Current aimed enemy. | |
int | m_eTeam |
int | m_eClass |
boolean | m_bFighting |
Variable indicating if agent is fighting at this moment. | |
boolean | m_bEscaping |
Variable indicating if agent is escaping at this moment. | |
CMobile | m_Movement |
Current position, direction, and so on. | |
int | m_iSoldiersCount |
int | m_iMedicsCount |
int | m_iEngineersCount |
int | m_iFieldOpsCount |
int | m_iTeamCount |
CThreshold | m_Threshold |
Limits of some variables (to trigger some events). | |
CTerrainMap | m_Map |
Current Map. | |
String | m_sMedicService |
String | m_sAmmoService |
String | m_sBackupService |
Static Protected Attributes | |
static final int | TRANSITION_DEFAULT = 0 |
static final int | TRANSITION_TO_STANDING = 1 |
static final int | TRANSITION_TO_GOTO_TARGET = 2 |
static final int | TRANSITION_TO_TARGET_REACHED = 3 |
static final int | TRANSITION_TO_FIGHTING = 4 |
static final int | MV_OK = 0 |
static final int | MV_CANNOT_GET_POSITION = 1 |
static final int | MV_NOT_MOVED_BY_TIME = 2 |
Classes | |
class | FSM_Fighting |
class | FSM_GoToTarget |
class | FSM_Quit |
class | FSM_Standing |
class | FSM_TargetReached |
|
'setup' method of jade agents. This method perform actions in common to CTroop agents (and derived classes) and calls parent's setup.
Reimplemented from Classes.CJGomasAgent. Reimplemented in Classes.CFieldOps, Classes.CMedic, and Classes.CSoldier. |
|
'takeDown' method of jade agents. This method calls parent's setup.
Reimplemented from Classes.CJGomasAgent. |
|
|
|
Get the current health of the agent.
|
|
Get the current ammunition of the agent.
|
|
Get the current stamina of the agent.
|
|
Use stamina from the stamina bar if possible (there is at least 5 units).
|
|
Get the current power of the agent.
|
|
Use power from the power bar if possible (there is at least 25 units). Power bar is reduced in 25 units.
|
|
Adds a type of service to the service type list. This method registers all types of services to offer in a list, excluding repeated services.
|
|
Checks our position on the static map. This method checks if our position on the static map is valid to walk on, and returns the result. It must be called before to update variables.
|
|
Checks a position on the static map. This method checks if a position on the static map is valid to walk on, and returns the result.
|
|
Adds a task to the task list. This method adds a task to the task list with the default priority in agreement to the type of task. If there is a task of same type and same owner, it doesn't create a new task: simply substitutes some attributes with newer values.
|
|
Adds a task to the task list with a modified priority. This method adds a task to the task list with the priority passed as parameter, non the standard priority. If there is a task of same type and same owner, it doesn't create a new task: simply substitutes some attributes with newer values.
|
|
The agent looks in the direction he is walking.
This method sends a FIPA INFORM message to Manager. Once message is sent, agent will be blocked waiting a response message from Manager. The content of received message is stored in the variable
|
|
The agent shoots in the direction he is aiming.
This method sends a FIPA INFORM message to Manager. Once message is sent, the variable
|
|
Action to do when agent has an enemy at sight. This method is called when agent has looked and has found an enemy, calculating (in agreement to the enemy position) the new direction where is aiming.
|
|
To know if an enemy is aimed.
This method is called just before agent can shoot. If an enemy is aimed, a value of
|
|
To know the team of an enemy in sight.
This method usually is called in the
|
|
To know the class of an enemy in sight.
This method usually is called in the
|
|
Request for medicine.
This method sends a FIPA REQUEST message to all agents who offers the
The content of message is:
Variable It's very useful to overload this method.
|
|
Request for ammunition.
This method sends a FIPA REQUEST message to all agents who offers the
The content of message is:
Variable It's very useful to overload this method.
|
|
Request for backup.
This method sends a FIPA REQUEST message to all agents who offers the
The content of message is:
Variable It's very useful to overload this method.
|
|
Update priority of all 'prepared (to execute)' tasks. This method is invoked in the state STANDING, and it's used to re-calculate the priority of all tasks (targets) int the task list of the agent. The reason is because JGOMAS Kernel always execute the maximum priority task. It's very useful to overload this method.
|
|
Should we update now all 'prepared (to execute)' tasks?
This method is a decision function invoked in the state GOTO_TARGET. A value of It's very useful to overload this method.
|
|
The agent has got the objective pack. This method is called when this agent walks on the objective pack, getting it. It's very useful to overload this method.
|
|
Definition of priorities for each kind of task.
This method can be implemented in CTroop's derived classes to define the task's priorities in agreement to the role of the new class. Priorities must be defined in the array It's very useful to overload this method.
Reimplemented in Classes.CFieldOps, Classes.CMedic, and Classes.CSoldier. |
|
Action to do if this agent cannot shoot. This method is called when the agent try to shoot, but has no ammo. The agent will spit enemies out. :-) It's very useful to overload this method.
|
|
Action to do when this agent reaches the target of current task. This method is called when the agent goes to state TARGET_REACHED. In agreement to current task, agent must realize some actions (for example, to get next point to walk from patrolling path). The actions in common to all roles are implemented at this level of hierarchy: TASK_PATROLLING, TASK_WALKING_PATH, TASK_RUN_AWAY. It's very useful to overload this method.
Reimplemented in Classes.CFieldOps, and Classes.CMedic. |
|
Calculates a new destiny position to escape. This method is called before the agent creates a task for escaping. It generates a valid random point in a radius of 50 units. Once position is calculated, agent updates its destiny to the new position, and automatically calculates the new direction. It's very useful to overload this method.
|
|
Calculates a new destiny position to walk.
This method is called before the agent creates a It's very useful to overload this method.
|
|
Calculates an array of positions for patrolling.
When this method is called, it creates an array of It's very useful to overload this method.
|
|
Action to do when the agent tries to escape.
This method is called just before this agent creates a It's very useful to overload this method.
|
|
Calculates if there is an enemy at sight.
This method scans the list It's very useful to overload this method.
|
|
Action to do when the agent is looking at.
This method is called just after Look method has ended. At this point, the only thing it does is to update variable It's very useful to overload this method.
|
|
Variable used to store the AID of Manager.
|
|
List of prepared to execut tasks.
|
|
Variable used to point the current task in execution.
|
|
Variable indicating if this agent is carrying the objective pack (flag).
|
|
Array of default values of priorities for each task.
|
|
Array of points used in patrolling task.
|
|
Current position in array m_ControlPoints.
|
|
Array of points used in walking (a calculated) path task.
|
|
Current position in array m_AStarPath.
|
|
List of objects in the agent's Field Of Vision.
|
|
Current aimed enemy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Variable indicating if agent is fighting at this moment.
|
|
Variable indicating if agent is escaping at this moment.
|
|
Current position, direction, and so on. .. |
|
|
|
|
|
|
|
|
|
|
|
Limits of some variables (to trigger some events).
|
|
Current Map.
|
|
|
|
|
|
|