Exemplo n.º 1
0
        /// <summary>
        /// Returns a Card Type based on its descriptor
        /// </summary>
        /// <param name="cardDescriptor">Describes the Card type to be returned</param>
        /// <returns>The specified Card</returns>
        public Card GetNewCard(string cardDescriptor)
        {
            switch (cardDescriptor)
            {
            case ("story"):
                string nextStateId = string.IsNullOrEmpty(CurrentPlotCard.NextStateId)
                        ? CurrentPlotCard.Id
                        : CurrentPlotCard.NextStateId;
                CurrentPlotCard = reader.AllStoryStates.Single(s => s.Id.Equals(nextStateId));
                return(CurrentPlotCard);

            case ("minor"):
                if (minorCards.Count == 0)
                {
                    minorCards = new List <Card>(reader.AllMinorStates);
                    minorCards.Randomize();
                }

                var minorCard = minorCards.First();
                minorCards.Remove(minorCard);
                return(minorCard);

            default:
                throw new System.ArgumentException("Argument invalid for CardFactory");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the current card to the first card of the third level of the game. Used by CheatsManager.
        /// </summary>
        /// <returns>First card in third level of the game</returns>
        public Card GetLevelThreeCard()
        {
            var card = reader.AllStoryStates.Single(s => s.Id.Equals(LEVEL_THREE_STATE_ID));

            CurrentPlotCard = card;
            return(card);
        }
Exemplo n.º 3
0
        public CardFactory()
        {
            reader          = Reader.Reset();
            CurrentPlotCard = reader.RootState;
            minorCards      = new List <Card>(reader.AllMinorStates);

            minorCards.Randomize();
        }