private void OnGameForfeit(object sender, TeamName e) { GameResult result = new GameResult(); //This is misleading in this case it is actually the team that forfeited the game result.Winner = e; result.WinType = WinType.Forfeit; _stats.DisplayForfeitMessage(result); ScoreKeeper.UpdateStats(result); HandleEndOfRound(); }
void BuildView() { TeamStats redTeamStats = ScoreKeeper.GetRedTeamStats(); TeamStats blackTeamStats = ScoreKeeper.GetBlackTeamStats(); RedTeamWinCount.text = BuildWinCountDisplay(redTeamStats); BlackTeamWinCount.text = BuildWinCountDisplay(blackTeamStats); RedTeamWintypeDisplay.text = BuildWinTypeDisplay(redTeamStats); BlackTeamWinTypeDisplay.text = BuildWinTypeDisplay(blackTeamStats); RedTeamPlayedByText.text = BuildPlayedByText(redTeamStats); BlackTeamPlayedByText.text = BuildPlayedByText(blackTeamStats); }
private void CheckGameState() { GameState gameState = _moveManager.GetCurrentGameState(); GameResult result = winChecker.CheckWin(gameState.CurrentBoardState); if (result.GameStatus == GameStatus.Completed) { _stats.DisplayWinMessage(result, TurnCount); StartCoroutine(DisplayWinningPieces(_gameBoard.GetListofBoardPositionsInGameSpace(result.WinningPositions))); ScoreKeeper.UpdateStats(result); HandleEndOfRound(); } else if (gameState.AvailableMoves.Count == 0) { _stats.DisplayDrawMessage(); HandleEndOfRound(); } }