/// <summary> /// Checks and updates the game state based on previous actions /// </summary> internal void CheckGameState() { var boardWinner = Board.Winner(); if (boardWinner != null) { WinStatus = GameWinStatus.Win; Winner = boardWinner; } else { if (!Board.IsFull()) return; WinStatus = GameWinStatus.Tie; Winner = null; } ActionLog(string.Format("Game Finished[{0}]: {1}", WinStatus, Winner)); Status = GameStatus.Finished; }
public RunResult(IPlayer winner, GameWinStatus status, long milliseconds) { Winner = winner; Status = status; Milliseconds = milliseconds; }
public void Reset() { Status = GameStatus.Running; WinStatus = GameWinStatus.None; Winner = null; Board = new GameBoard(); GameActions = new List<GameAction>(); GameLog = new List<string>(); ActionQueue = new ConcurrentQueue<GameAction>(); OnPropertyChanged("Board"); OnPropertyChanged("GameActions"); OnPropertyChanged("GameLog"); }