Beispiel #1
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();
     }
 }
Beispiel #2
0
 public override void Execute(GameModel gameState)
 {
     gameState.ProphecyArea.Clear();
     gameState.MainDeck.Remove(Location);
     gameState.DiscardPile.Add(Location);
     NextCommand = new Draw();
 }
 public override void Execute(GameModel gameState)
 {
     gameState.Hand.Remove(Location);
     gameState.DiscardPile.Add(Location);
     gameState.Doors.Add(gameState.DrawnDoor);
     gameState.DrawnDoor = null;
     NextCommand = new Draw();
 }
Beispiel #4
0
 public override void Execute(GameModel gameState)
 {
     gameState.MainDeck.Remove(_door);
     if(gameState.Hand.Any(x => x.Symbol == CardSymbolEnum.Key && x.Color == _door.Color))
     {
         gameState.DrawnDoor = _door;
     }
     else
     {
         gameState.Limbo.Add(_door);
         NextCommand = new Draw();
     }
 }
 public override void Execute(GameModel gameState)
 {
     gameState.Hand.Remove(Location);
     gameState.DiscardPile.Add(Location);
     if(Location.Symbol == CardSymbolEnum.Key)
     {
         NextCommand = new Prophecy();
     }
     else
     {
         NextCommand = new Draw();
     }
 }
Beispiel #6
0
 public override void Execute(GameModel gameState)
 {
     gameState.PlayArea.Add(Location);
     gameState.Hand.Remove(Location);
     if(gameState.PlayArea.Count() >= 3)
     {
         var reversePlayArea = gameState.PlayArea.Reverse<Card>();
         var lastThreeGrouped = reversePlayArea.Take(3).GroupBy(x => x.Color);
         if(lastThreeGrouped.Count() == 1)
         {
             NextCommand = new GainDoor(lastThreeGrouped.First().Key);
         }
         else
         {
             NextCommand = new Draw();
         }
     }
     else
     {
         NextCommand = new Draw();
     }
 }
Beispiel #7
0
 public override void Execute(GameModel gameState)
 {
     gameState.Limbo.Add(gameState.DrawnDoor);
     gameState.DrawnDoor = null;
     NextCommand = new Draw();
 }
 public override void Execute(GameModel gameState)
 {
     gameState.MainDeck.Remove(_nightmare);
     gameState.DiscardPile.Add(_nightmare);
     NextCommand = new Draw();
 }