Beispiel #1
0
 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;
 }
        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;
        }
Beispiel #3
0
 private void DrawHand(Player player)
 {
     for (int i = 0; i < Math.Min(5, stock.Count); i++)
     {
         player.TakeCard(stock.Deal());
     }
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
        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;
            }
        }