// 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; }
// 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; }
public AttackEnemyState(RecruitmentPattern statePatternUnit, PursuitBehavior pursuitBehavior) { state = statePatternUnit; pursuit = pursuitBehavior; }
public AttackUnitState(WavePattern statePatternEnemy, PursuitBehavior pursuitBehavior) { state = statePatternEnemy; pursuit = pursuitBehavior; }