Download User Manual PG

Transcript
the member variable myTactic must be of type IMovementTactic. The successive application is quite easy. The abstract class Strategy calls the update()
method of all its registered tactics at the beginning of its computeNextStep()
methods. So the usage of a tactic basically reduces to check if a tactic has an action available to perfom by calling this.myTactic.hasAction(). If so, the tactic may decide to execute this action with this.myTactic.performAction().
For the different sub-interfaces of ITactic there are some additional methods
available to help the strategy in deciding whether to execute a particular tactic
or not. For instance, the method getTargetPosition() in IMovementTactic
allows to check which destination is targeted by the tactic even before calling
the performAction() method.