Example #1
0
    // Constructor
    public WavePattern(Unit unit)
    {
        _unit = unit;

        seekBehavior    = new SeekBehavior(_unit);
        pursuitBehavior = new PursuitBehavior(_unit);

        reachTargetState  = new ReachTargetState(this, seekBehavior);
        attackTargetState = new AttackTargetState(this, seekBehavior);
        attackUnitState   = new AttackUnitState(this, pursuitBehavior);

        currentState = reachTargetState;
    }
Example #2
0
    // Constructor
    public RecruitmentPattern(Unit unit)
    {
        _unit = unit;

        waitBehavior    = new WaitBehavior(_unit);
        seekBehavior    = new SeekBehavior(_unit);
        pursuitBehavior = new PursuitBehavior(_unit);

        waitState           = new WaitState(this, waitBehavior);
        followLeaderState   = new FollowLeaderState(this, seekBehavior);
        holdPositionState   = new HoldPositionState(this, waitBehavior);
        defendPositionState = new DefendPositionState(this, pursuitBehavior);
        attackEnemyState    = new AttackEnemyState(this, pursuitBehavior);
        attackTargetState   = new AttackLeaderTargetState(this, seekBehavior);
        workState           = new WorkState(this, waitBehavior);

        currentState = waitState;
    }
 public DefendPositionState(RecruitmentPattern statePatternUnit, PursuitBehavior pursuitBehavior)
 {
     state   = statePatternUnit;
     pursuit = pursuitBehavior;
 }
Example #4
0
 public AttackEnemyState(RecruitmentPattern statePatternUnit, PursuitBehavior pursuitBehavior)
 {
     state   = statePatternUnit;
     pursuit = pursuitBehavior;
 }
Example #5
0
 public AttackUnitState(WavePattern statePatternEnemy, PursuitBehavior pursuitBehavior)
 {
     state   = statePatternEnemy;
     pursuit = pursuitBehavior;
 }