Пример #1
0
 private static void ShowCardPossibilities(ClueSolver solver)
 {
     Console.WriteLine();
     Console.WriteLine("BY CARD");
     Console.WriteLine("--------------------");
     foreach (var category in solver.Game.CardsByCategory.Keys)
     {
         Console.WriteLine();
         Console.WriteLine($"{category.ToUpperInvariant()}");
         foreach (Card card in solver.Game.CardsByCategory[category])
         {
             Console.Out.Write($"{card}:".PadRight(20));
             Console.Write(string.Join(", ", solver.GetPotentialOwners(card)));
             Console.WriteLine();
         }
     }
 }
Пример #2
0
        private void ShowPossibleOwners(ClueSolver game)
        {
            var allCards = new SortedSet <Card>();

            foreach (ISet <Card> cards in game.Cards.Values)
            {
                allCards.UnionWith(cards);
            }
            foreach (Card card in allCards)
            {
                Console.Out.WriteLine(card);
                foreach (string name in game.GetPotentialOwners(card))
                {
                    Console.Out.WriteLine($"\t{name}");
                }
            }
        }