public bool TryReserve(Development development) { if (HandFull) { return(false); } _reservedDevelopmentsInternal.Add(development); return(true); }
private bool TakeFromPublic(Development developmentToTake, out Development actuallyTaken) { if (PublicDevelopments.Contains(developmentToTake)) { actuallyTaken = developmentToTake; _boardDevelopmentsInternal.Remove(developmentToTake); return(true); } actuallyTaken = null; return(false); }
public bool TryRemoveDevelopment(Location location, Development developmentToTake, out Development actuallyTaken) { switch (location) { case Location.Public: default: return(TakeFromPublic(developmentToTake, out actuallyTaken)); case Location.Level1Deck: return(TakeFromDeck(_lvl1Deck, out actuallyTaken)); case Location.Level2Deck: return(TakeFromDeck(_lvl2Deck, out actuallyTaken)); case Location.Level3Deck: return(TakeFromDeck(_lvl3Deck, out actuallyTaken)); } }
public void BuyDevelopment(Development development) => _purchasedDevelopmentsInternal.Add(development);
public bool TryRemoveReserved(Development developmentToBuy) => _reservedDevelopmentsInternal.Remove(developmentToBuy);
private bool TakeFromDeck(Deck <Development> deck, out Development actuallyTaken) { actuallyTaken = deck.IsEmpty ? null : deck.Draw().First(); return(actuallyTaken != null); }