Ejemplo n.º 1
0
        public int UpdateV4(ArenaInfo enemyInfo, BattleLog.Result result)
        {
            DailyChallengeCount--;
            switch (result)
            {
            case BattleLog.Result.Win:
                ArenaRecord.Win++;
                break;

            case BattleLog.Result.Lose:
                ArenaRecord.Lose++;
                break;

            case BattleLog.Result.TimeOver:
                ArenaRecord.Draw++;
                return(0);

            default:
                throw new ArgumentOutOfRangeException(nameof(result), result, null);
            }

            var earnedScore = ArenaScoreHelper.GetScoreV2(Score, enemyInfo.Score, result);

            Score = Math.Max(1000, Score + earnedScore);
            return(earnedScore);
        }
Ejemplo n.º 2
0
 public void GetScoreV2(int challengerScore, int defenderScore, int win, int timeOver, int lose)
 {
     Assert.Equal(win, ArenaScoreHelper.GetScoreV2(challengerScore, defenderScore, Result.Win));
     Assert.Equal(timeOver, ArenaScoreHelper.GetScoreV2(challengerScore, defenderScore, Result.TimeOver));
     Assert.Equal(lose, ArenaScoreHelper.GetScoreV2(challengerScore, defenderScore, Result.Lose));
 }