Exemplo n.º 1
0
 public State RemoveCardFromHand(Card card)
 {
     if (card is Occupation)
     {
         HandOccupations = HandOccupations.Remove(card);
     }
     else if (card is MinorImprovement)
     {
         HandMinors = HandMinors.Remove(card);
     }
     else
     {
         throw new InvalidOperationException("Only minor improvements and occupations can be removed from a players hand.");
     }
     return(State);
 }
Exemplo n.º 2
0
        public State PlayCard(Card card)
        {
            if (HandOccupations.Contains(card))
            {
                HandOccupations = HandOccupations.Remove(card);
            }
            else if (HandMinors.Contains(card))
            {
                HandMinors = HandMinors.Remove(card);
            }
            else
            {
                return(State);
            }

            OwnedCards = OwnedCards.Add(card);
            return(State);
        }