コード例 #1
0
        /// <summary>
        /// deal draw after player discards
        /// </summary>
        /// <param name="seat"></param>
        public void DealPlayerDraw(int seat)
        {
            List <Card> discards = new List <Card>();
            Player      p        = PlayersList.GetPlayerBySeat(seat);

            if (p != null)
            {
                //puill cards from the deck
                List <Card> cards = new DeckService().DealCards(ref Deck, p.Discard.Count);

                //pass the draw onto the player
                PlayersList.Draw(p, cards);
            }
        }
コード例 #2
0
        /// <summary>
        /// deal all players in the game draw cards
        /// </summary>
        public void DealPlayersDraw()
        {
            //todo: dealer should go last ie p1,p2,p3,dealer
            foreach (Player p in PlayersList.GetPlayers())
            {
                //puill cards from the deck
                List <Card> cards = new DeckService().DealCards(ref Deck, p.Discard.Count);

                //pass the draw onto the player
                PlayersList.Draw(p, cards);
            }

            State = BPConstants.GS_Draw;
        }
コード例 #3
0
        /// <summary>
        /// start the game
        /// </summary>
        /// <returns></returns>
        public bool StartGame()
        {
            //shuffle the deck
            State = BPConstants.GS_ShuffleDeck;
            //use the deck service to shuffle the carda
            DeckService ds = new DeckService();

            Deck = ds.ShuffleDeck(Deck);

            //clear the players current hand
            PlayersList.InitHand();

            //deal hands to all the players
            State = BPConstants.GS_Deal;
            PlayersList.Deal(ref Deck, BPConstants.FiveCards);

            State = BPConstants.GS_WaitForDiscard;

            return(true);
        }