예제 #1
0
        public override void Execute(GameModel gameState)
        {
            // draw card
            var card = gameState.MainDeck.First();

            // if location, add to hand
            if (card.Type == CardTypeEnum.Location)
            {
                gameState.MainDeck.Remove(card);
                gameState.Hand.Add(card);
            }
            // else, add to limbo
            else
            {
                gameState.MainDeck.Remove(card);
                gameState.Limbo.Add(card);
            }

            // if hand == 5 next command shuffle
            if(gameState.Hand.Count() == 5)
            {
                NextCommand = new Shuffle();
            }
            // else next command drawlocations
            else
            {
                NextCommand = new DrawLocations();
            }
        }
예제 #2
0
 public override void Execute(GameModel gameState)
 {
     var cardToDraw = gameState.MainDeck.FirstOrDefault();
     if (cardToDraw != null)
     {
         if (cardToDraw.Type == CardTypeEnum.Location)
         {
             gameState.Hand.Add(cardToDraw);
             gameState.MainDeck.Remove(cardToDraw);
             if(gameState.Hand.Count == 5)
             {
                 NextCommand = new Shuffle();
             }
             else
             {
                 NextCommand = new Draw();
             }
         }
         else if (cardToDraw.Type == CardTypeEnum.Door)
         {
             NextCommand = new HandleDoor(cardToDraw);
         }
         else if (cardToDraw.Type == CardTypeEnum.Nightmare)
         {
             NextCommand = new HandleNightmare(cardToDraw);
         }
     }
     else
     {
         NextCommand = new Lose();
     }
 }