示例#1
0
文件: Holdem.cs 项目: Royathe/CIRCB
        private void PlayerLose(HoldemPlayer player, bool byTimeout = false)
        {
            Bot.Say(player.PlayerName, "Hävisit: " + player.Bet);
            Pot += player.Bet;
            Players.Remove(player);

            var PlayerScore = new Score(player.PlayerUserId, Score.Holdem);

            PlayerScore.TotalGains -= player.Bet;

            if (byTimeout)
            {
                PlayerScore.GamesForfeitted = 1;
            }
            Users.Get(player.PlayerName).UpdateScore(PlayerScore);
        }
示例#2
0
文件: Holdem.cs 项目: Royathe/CIRCB
        private void SetNewBet(int newBet, HoldemPlayer player)
        {
            ResetPlayerChecks();
            SetBasicTimer();

            // Increase bet
            CurrentBet = newBet;

            if (CurrentBet > MaximumBet)
            {
                CurrentBet = MaximumBet;
            }
            if (CurrentBet > player.Funds)
            {
                CurrentBet = player.Funds;
            }

            Bot.Say("Veto nostettu => " + CurrentBet);
        }
示例#3
0
        public bool Join(User user)
        {
            if (CurrentPhase == Phase.Join)
            {
                if (!Players.Any(x => x.UserId == user.UserId))
                {
                    var player = new HoldemPlayer(user);
                    player.Cards[0] = Deck.Draw();
                    player.Cards[1] = Deck.Draw();
                    Players.Add(player);

                    if (Players.Count == 2)
                    {
                        Timer.Set(RoundTimeLimit, TimeLimit);
                    }
                    return(true);
                }
            }
            return(false);
        }