Classes.CMedic Class Reference

Inherits Classes.CTroop.

Inheritance diagram for Classes.CMedic:

Inheritance graph
[legend]
Collaboration diagram for Classes.CMedic:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

void setup ()
 'setup' method of jade agents.
void SetUpPriorities ()
 Definition of priorities for each kind of task.
boolean checkMedicAction (String _sContent)
 Decides if agent accepts the CFM request.
void PerformTargetReached (CTask _CurrentTask)
 Action to do when this agent reaches the target of current task.
final int CreateMedicPack ()
 Creates medic packs if possible.

Static Protected Attributes

static int m_iPacksDelivered = 0
 inner variable used to name packs

Member Function Documentation

void Classes.CMedic.setup  )  [protected]
 

'setup' method of jade agents.

This method perform actions in common to CMedic agents (and derived classes) and calls parent's setup.

Parameters:
- 
Returns:
-

Reimplemented from Classes.CTroop.

void Classes.CMedic.SetUpPriorities  )  [protected]
 

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 m_TaskPriority.

It's very useful to overload this method.

Parameters:
- 
Returns:
-

Reimplemented from Classes.CTroop.

boolean Classes.CMedic.checkMedicAction String  _sContent  )  [protected]
 

Decides if agent accepts the CFM request.

This method is a decision function invoked when a CALL FOR MEDIC request has arrived. Parameter sContent is the content of message received in CFM responder behaviour as result of a CallForMedic request, so it must be: ( x , y , z ) ( health ) . By default, the return value is TRUE, so agents always accept all CFM requests.

It's very useful to overload this method.

Parameters:
_sContent 
Returns:
TRUE

void Classes.CMedic.PerformTargetReached CTask  _CurrentTask  )  [protected]
 

Action to do when this agent reaches the target of current task.

This method is called when this agent goes to state TARGET_REACHED. If current task is TASK_GIVE_MEDICPAKS, agent must give medic packs, but in other case, it calls to parent's method.

It's very useful to overload this method.

Parameters:
_CurrentTask 
Returns:
-

Reimplemented from Classes.CTroop.

final int Classes.CMedic.CreateMedicPack  )  [protected]
 

Creates medic packs if possible.

This method allows to create medic packs if there is enough power in the agent's power bar.

Parameters:
- 
Returns:
iPacksDelivered: number of medic packs created


Member Data Documentation

int Classes.CMedic.m_iPacksDelivered = 0 [static, protected]
 

inner variable used to name packs


The documentation for this class was generated from the following file:
Generated on Fri Dec 16 20:13:50 2005 for JGomas by  doxygen 1.4.5