Esempio n. 1
0
        private bool IsHighestRankingUser(User user)
        {
            lock (_serverLock)
            {
                var userLeague    = _usersLeagues[user];
                var highestLeague = _leaguesByType.Last().Value;
                var highestUser   = highestLeague.GetMaxRankedUser();

                return(userLeague != null && userLeague.Type >= highestLeague.Type &&
                       user.GetRank() >= highestUser.GetRank());
            }
        }
Esempio n. 2
0
        public void UpdateUserRank(User player, GameProperties gameProperties)
        {
            var hands    = gameProperties.HighestHand;
            var handRank =
                (from hand in hands where hand.Value.Equals(player) select(int) hands.Max().Key - (int)hand.Key)
                .FirstOrDefault();

            var bets    = gameProperties.HighestBet;
            var betRank =
                (from bet in bets where bet.Value.Equals(player) select bets.Max().Key - bet.Key)
                .FirstOrDefault();

            player.SetRank(player.GetRank() + handRank + betRank);
        }
Esempio n. 3
0
 public int GetRank(User user)
 {
     return(user.GetRank());
 }