private void SwitchTurnState(TurnState turnState) { if (turnState != turn) { turn.Exit(); turn = turnState; turn.Enter(); } }
public void GameStart() { ruleManager.Init(); ruleManager.FindSquaresToPut(currentTurn); currentTurn.Enter(ruleManager); view.ShowCurrentBoard(ruleManager.Board); view.ShowInputMessage(currentTurn); currentTurn.Execute(ruleManager); }
public void NextTurn() { currentTurn.Exit(ruleManager); view.ShowCurrentBoard(ruleManager.Board); var next = currentTurn; currentTurn = nextTurn; nextTurn = next; ruleManager.FindSquaresToPut(currentTurn); currentTurn.Enter(ruleManager); view.ShowInputMessage(currentTurn); currentTurn.Execute(ruleManager); }
private void BeginTurn() { PlayerInfo player = mapManager.Players[currentPlayer]; foreach (Unit unit in player.Units) { if (unit != null) { unit.BeginTurn(); } } turn = new ReadyState(ui, player); turn.Enter(); player.MainCamera.gameObject.SetActive(true); player.MinimapCamera.gameObject.SetActive(true); }
private void Enter(TurnState next) { current.Exit(); current = next; next.Enter(); }