Exemplo n.º 1
0
        private void HandleBetRequest(GamePeer gamePeer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var room = FindPeerRoom(gamePeer) as BlackjackGameRoom;

            var sendBetRequest = new SendBetRequest(gamePeer.Protocol, operationRequest);

            if (room != null)
            {
                room.Bet(gamePeer, sendBetRequest);
            }
        }
Exemplo n.º 2
0
        public void Bet(GamePeer peer, SendBetRequest sendBet)
        {
            BlackjackPlayer player = playerManager.GetPlayer(peer) as BlackjackPlayer;
            BlackjackBet    playerBet;

            playerBet.initialBet = sendBet.BetMoney;
            playerBet.totalBet   = sendBet.BetMoney;

            if (HasBet(player) == false && CanBet(player, playerBet))
            {
                playerBetsDic.Add(player, playerBet);

                BroadcastBetDone(player);
            }

            CheckAllBet(false);
        }