Exemple #1
0
 /// <summary>
 /// Resolves the Hired Scouts Event
 /// </summary>
 /// <param name="game">The GameState</param>
 /// <param name="hunterPlayingEvent">The Hunter playing the Event</param>
 /// <param name="logic">The artificial intelligence component</param>
 private static void PlayHiredScouts(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic)
 {
     Console.WriteLine("Name the first city");
     var firstLocationToReveal = Location.Nowhere;
     while (firstLocationToReveal == Location.Nowhere || (game.Map.TypeOfLocation(firstLocationToReveal) != LocationType.SmallCity && game.Map.TypeOfLocation(firstLocationToReveal) != LocationType.LargeCity))
     {
         firstLocationToReveal = Enumerations.GetLocationFromString(Console.ReadLine());
     }
     var secondLocationToReveal = Location.Nowhere;
     Console.WriteLine("Name the second city");
     secondLocationToReveal = Location.Nowhere;
     while (secondLocationToReveal == Location.Nowhere || (game.Map.TypeOfLocation(secondLocationToReveal) != LocationType.SmallCity && game.Map.TypeOfLocation(secondLocationToReveal) != LocationType.LargeCity))
     {
         secondLocationToReveal = Enumerations.GetLocationFromString(Console.ReadLine());
     }
     if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, firstLocationToReveal, logic))
     {
         Console.WriteLine("Dracula prevented a location from being revealed");
         logic.EliminateTrailsThatDoNotContainLocation(game, firstLocationToReveal);
     }
     else
     {
         var trailIndex = game.Dracula.RevealCardInTrailWithLocation(firstLocationToReveal);
         if (trailIndex > -1)
         {
             Console.WriteLine("{0} revealed", firstLocationToReveal.Name());
             logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, firstLocationToReveal, trailIndex);
             trailIndex = -2;
         }
         else
         {
             trailIndex = game.Dracula.RevealCardInCatacombsWithLocation(firstLocationToReveal);
         }
         if (trailIndex > -1)
         {
             Console.WriteLine("{0} revealed", firstLocationToReveal.Name());
             logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, firstLocationToReveal, trailIndex);
             game.Dracula.RevealEncountersAtPositionInTrail(trailIndex);
             DrawGameState(game);
         }
         else if (trailIndex == -1)
         {
             Console.WriteLine("{0} is not in Dracula's trail or Catacombs", firstLocationToReveal.Name());
             logic.EliminateTrailsThatContainLocation(game, firstLocationToReveal);
         }
     }
     if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, secondLocationToReveal, logic))
     {
         Console.WriteLine("Dracula prevented a location from being revealed");
         logic.EliminateTrailsThatDoNotContainLocation(game, secondLocationToReveal);
     }
     else
     {
         var trailIndex = game.Dracula.RevealCardInTrailWithLocation(secondLocationToReveal);
         if (trailIndex > -1)
         {
             Console.WriteLine("{0} revealed", secondLocationToReveal.Name());
             logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, secondLocationToReveal, trailIndex);
             trailIndex = -2;
         }
         else
         {
             trailIndex = game.Dracula.RevealCardInCatacombsWithLocation(secondLocationToReveal);
         }
         if (trailIndex > -1)
         {
             Console.WriteLine("{0} revealed", secondLocationToReveal.Name());
             logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, secondLocationToReveal, trailIndex);
             game.Dracula.RevealEncountersAtPositionInTrail(trailIndex);
             DrawGameState(game);
         }
         else if (trailIndex == -1)
         {
             Console.WriteLine("{0} is not in Dracula's trail or Catacombs", secondLocationToReveal.Name());
             logic.EliminateTrailsThatContainLocation(game, secondLocationToReveal);
         }
     }
 }