public void SwitchState(PlayerState state) { // State machine transition code goes here if (state == PlayerState.EndTurn) { _character.Selected = false; _subjectComponent.Notify(this, ObserverEvent.PlayerEndedTurn); } switch (_state.Peek()) { case PlayerState.Idle: if (state == PlayerState.ObserveProjectile) { _observeDelay = Constants.CameraAfterExplosionDelay; } break; case PlayerState.ObserveProjectile: if (state == PlayerState.ObserveSatellite) { _subjectComponent.Notify(this, ObserverEvent.FocusOnSatellite); } _observeDelay = Constants.CameraAfterExplosionDelay * 1.2; break; case PlayerState.ObserveSatellite: if (state == PlayerState.ObserveSatelliteStrike) { _subjectComponent.Notify(this, ObserverEvent.FocusOnSatelliteStrike); } _subjectComponent.Notify(this, ObserverEvent.FireSatellite); _observeDelay = Constants.CameraAfterExplosionDelay * 1.2; break; case PlayerState.ObserveSatelliteStrike: //if (state == PlayerState.EndTurn) //_subjectComponent.Notify(this, ObserverEvent.PlayerEndedTurn); break; } _state.Switch(state); }
public void Draw() { _environment.Draw(); _logicalTerrain.Draw(); //SwinGame.DrawBitmap("windMarker", _camera.Pos.X + (_windowRect.Width / 2), _camera.Pos.Y + 50); _windMarker.Draw(); SwinGame.DrawText("Selected Player: " + _selectedPlayer.Name, Color.Black, 50, 70); _selectedPlayer.Draw(); SwinGame.DrawText("World State: " + _state.Peek(), Color.Black, _camera.Pos.X + 20f, _camera.Pos.Y + 40f); SwinGame.DrawText("Player State: " + _selectedPlayer.PeekState(), Color.Black, _camera.Pos.X + 20f, _camera.Pos.Y + 50f); SwinGame.DrawText("Character State: " + _selectedPlayer.Character.PeekState(), Color.Black, _camera.Pos.X + 20f, _camera.Pos.Y + 60f); }
public MenuState PeekState() { return(_stateComponent.Peek()); }
public DynamicImageState PeekState() { return(_stateComponent.Peek()); }
public PlayerSelectState PeekState() { return(_stateComponent.Peek()); }
public CombatState PeekState() { return(_state.Peek()); }