public TowerAction() { TowerActionState observingState = new ObservingState(); TowerActionState shootingState = new ShootingState(); TowerActionState reloadingState = new ReloadingState(); observingState.SetNextState(shootingState); shootingState.SetNextState(reloadingState); reloadingState.SetNextState(observingState); currentState = observingState; }
public void SetNextState(TowerActionState nextState) { this.nextState = nextState; }