gecco.game.dke
Class MarchAction

java.lang.Object
  |
  +--gecco.server.core.Action
        |
        +--gecco.game.dke.MoveAction
              |
              +--gecco.game.dke.MarchAction
All Implemented Interfaces:
ReplayReady

public class MarchAction
extends MoveAction


Field Summary
 
Fields inherited from interface gecco.server.replaymanager.ReplayReady
AUTOMATON, MOVING_ACTION, UNIT
 
Constructor Summary
MarchAction()
           
 
Method Summary
 ActionReturn checkPoint()
          This method is called periodically by the game engine.
 void initiate(int _actionHandle, int _unitHandle)
          Initialise the action without any arguments.
 void initiate(int _actionHandle, int _unitHandle, double _argX, double _argY)
          Initialise the action with a point as argument by calling super.initiate(_actionHandle, _unitHandle, _argX, _argY).
 void initiate(int _actionHandle, int _unitHandle, int _argUnitHandle)
          Initialise the action with a unit as argument.
 void prepareAbortion()
          Called from ActionProcessor when Action is aborted, lets Action abort gracefully
 void updateUnitStatus(boolean b)
           
 
Methods inherited from class gecco.game.dke.MoveAction
calcAddXAddY, calcAddXAddY, expandVisitedToRouteWidth, getAutomatonImpl, getWarUnit, isCloseEnough, markAsVisited, playReplayData, saveReplayData, testUpdateVisited, updateUpdateVisited
 
Methods inherited from class gecco.server.core.Action
canSeePosition, getActionDefinition, getActionHandle, getArgumentUnit, getArgumentX, getArgumentY, getAutomatonState, getCooperativeUnits, getId, getNewActionHandle, getUnit, getUnitHandle, initiate, isInstantaneous, isOutsideMap, sendEventToAutomaton, sendEventToUnit, setActionDefinition, setArgumentUnit, setArgumentX, setArgumentY, setInstantaneous
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarchAction

public MarchAction()
Method Detail

initiate

public void initiate(int _actionHandle,
                     int _unitHandle)
Description copied from class: Action
Initialise the action without any arguments.

Overrides:
initiate in class Action
Parameters:
_actionHandle - A unique handle that should identify this action.
_unitHandle - The handle of the executing unit.

initiate

public void initiate(int _actionHandle,
                     int _unitHandle,
                     double _argX,
                     double _argY)
Initialise the action with a point as argument by calling super.initiate(_actionHandle, _unitHandle, _argX, _argY). Then check if there is a route to the endpoint.

Overrides:
initiate in class MoveAction
Parameters:
_actionHandle - A unique handle that should identify this action.
_unitHandle - The handle of the executing unit.
_argX - The x coordinate of the target point.
_argY - The y coordinate of the target point.

initiate

public void initiate(int _actionHandle,
                     int _unitHandle,
                     int _argUnitHandle)
Description copied from class: Action
Initialise the action with a unit as argument.

Overrides:
initiate in class Action
Parameters:
_actionHandle - A unique handle that should identify this action.
_unitHandle - The handle of the executing unit.
_argUnitHandle - The handle of the target unit.

checkPoint

public ActionReturn checkPoint()
This method is called periodically by the game engine.

Overrides:
checkPoint in class MoveAction
Returns:
An object of type ActionReturn, which encapsulates data about the status of the action after the checkpoint. Different instances of the class ActionReturn should be returned depending on whether the action is completed, aborted, or if the action should be requeued and the checkpoint method called again at some time later.

updateUnitStatus

public void updateUnitStatus(boolean b)
Overrides:
updateUnitStatus in class MoveAction

prepareAbortion

public void prepareAbortion()
Description copied from class: Action
Called from ActionProcessor when Action is aborted, lets Action abort gracefully

Overrides:
prepareAbortion in class MoveAction