/// <summary> /// Update the statistics with the winner of the latest game (and the difficult levels) /// </summary> /// <param name="playerName">Player name.</param> /// <param name="difficulties">Difficulties.</param> static void UpdateStatistics(PlayerName playerName, Difficulties difficulties) { if (statistics.ContainsKey(difficulties)) { statistics[difficulties].AddScore(playerName, 1); } else { PlayerScores playerScores = new PlayerScores(); playerScores.AddScore(playerName, 1); statistics.Add(difficulties, playerScores); } }
void StayOnPlayer() { transform.position = curOwner.transform.position + offset * curOwner.transform.localScale.y; int playerNum = -1; for (int i = 0; i < GameController.Instance.activePlayers.Length; i++) { if (GameController.Instance.activePlayers[i] == curOwner) { playerNum = i; } } if (playerNum != -1) { PlayerScores.AddScore(playerNum, Mathf.FloorToInt(Time.deltaTime * 1000)); } transform.RotateAround(Vector3.up, PlayerScores.GetScore(playerNum) * Time.deltaTime / 1000); }
// Add Score to the current player (Need points and current player) private void ScorePoints() { playerScores.AddScore(playerTurn, currentCard.pointsValue); scoreboard.UpdateScoreDisplay(GetCurrentScores()); }