public State AddCardToHand(Card card) { if (card is Occupation) { HandOccupations = HandOccupations.Add(card); } else if (card is MinorImprovement) { HandMinors = HandMinors.Add(card); } else { throw new InvalidOperationException("Only minor improvements and occupations can be added to a players hand."); } return(State); }
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); }
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); }