示例#1
0
 public Wonder(String name, bool A_side, int noOfLevels, Playcard startCard)
 {
     this.currentLevel = 0;
     this.name         = name;
     this.A_side       = A_side;
     this.noOfLevels   = noOfLevels;
     this.startCard    = startCard;
     this.levelCards   = null;
     this.stashedCards = new CardList();
 }
示例#2
0
        public Playcard upgrade(Playcard stashedCard)
        {
            if (this.currentLevel == this.noOfLevels)
            {
                return(null);
            }

            this.stashedCards.Add(this.currentLevel, stashedCard);
            this.currentLevel++;

            Playcard result       = null;
            int      desiredIndex = this.currentLevel - 1;

            System.Diagnostics.Trace.Assert(
                this.levelCards.TryGetValue(desiredIndex, out result),
                string.Format("Failed to get card at {0} !", desiredIndex)
                );

            return(result);
        }