コード例 #1
0
ファイル: Game.cs プロジェクト: ClarkChen633/MyCSharp
 public bool PullOutBooks(Player player)
 {
     IEnumerable<Values> booksPulled = player.PullOutBooks();
     foreach (Values value in booksPulled)
         books.Add(value, player);
     if (player.CardCount == 0)
         return true;
     return false;
 }
コード例 #2
0
        public bool PullOutBooks(Player player)
        {
            /*
                Monte os books de um jogador. Retorne true se o jogador ficar sem cartas,
                se não for o caso, retorne false. Cada book deve ser adicionado ao dicionário Books.
                Um jogador fica sem cartas quando usa todas as suas restantes para montar um book
                vaza - e assim ganha o jogo.
            */

            /*****************/
            IEnumerable<Values> booksPulled = player.PullOutBooks();

            foreach (Values value in booksPulled)
                books.Add(value, player);
            /*****************/

            //player.PullOutBooks();

            if (player.CardCount == 0)
                return true;
            return false;
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: MarkPThomas/HeadFirst-CSharp
 private void DrawHand(Player player)
 {
     for (int i = 0; i < Math.Min(5, stock.Count); i++)
     {
         player.TakeCard(stock.Deal());
     }
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: robertjorg/Ch8
 public bool PullOutBooks(Player player)
 {
     IEnumerable<Value> booksPulled = player.PullOutBooks();
     foreach (Value value in booksPulled)
     {
         this.books.Add(value, player);
     }
     if (player.CardCount == 0)
     {
         return true;
     }
     return false;
 }
コード例 #5
0
ファイル: Game.cs プロジェクト: MarkPThomas/HeadFirst-CSharp
        public bool PullOutBooks(Player player)
        {
            IEnumerable<Values> booksPulled = player.PullOutBooks();
            foreach (Values value in booksPulled)
            {
                books.Add(value, player);
            }
            OnPropertyChanged("Books");

            if (player.CardCount == 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }