示例#1
0
        public bool TryReserve(Development development)
        {
            if (HandFull)
            {
                return(false);
            }

            _reservedDevelopmentsInternal.Add(development);

            return(true);
        }
示例#2
0
        private bool TakeFromPublic(Development developmentToTake, out Development actuallyTaken)
        {
            if (PublicDevelopments.Contains(developmentToTake))
            {
                actuallyTaken = developmentToTake;
                _boardDevelopmentsInternal.Remove(developmentToTake);
                return(true);
            }

            actuallyTaken = null;
            return(false);
        }
示例#3
0
        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));
            }
        }
示例#4
0
 public void BuyDevelopment(Development development) => _purchasedDevelopmentsInternal.Add(development);
示例#5
0
 public bool TryRemoveReserved(Development developmentToBuy) => _reservedDevelopmentsInternal.Remove(developmentToBuy);
示例#6
0
        private bool TakeFromDeck(Deck <Development> deck, out Development actuallyTaken)
        {
            actuallyTaken = deck.IsEmpty ? null : deck.Draw().First();

            return(actuallyTaken != null);
        }