Esempio n. 1
0
        public (decimal WinningNewEloScore, decimal LosingNewEloScore) CalculateNewEloScore(decimal winningScore, decimal losingScore, int gameId, int kFactor)
        {
            var newElo = EloCalculator.CalculateElo(winningScore, losingScore, Convert.ToDecimal(EloCalculator.WIN), Convert.ToDecimal(EloCalculator.LOSE),
                                                    kFactor, kFactor);

            return(newElo[0], newElo[1]);
        }
Esempio n. 2
0
    public void OnMatchCreateClicked()
    {
        int winnerID = Winner.value + 1;
        int loserID  = loser.value + 1;

        if (winnerID != loserID)
        {
            EloCalculator.CalculateElo(winnerID, loserID);
            DatabaseController.addMatchPlayed(winnerID);
            DatabaseController.addMatchPlayed(loserID);
        }
        else
        {
            string title   = "Invalid Input";
            string message = "How are they playing themselfs?";
            //EditorUtility.DisplayDialog(title,message,"Ok");
        }
    }