/****************************** * Initializing *******************************/ private static void initializeComponents() { string textFilePath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory())) + @"\Data\DataEncr.txt"; //http://stackoverflow.com/questions/14549766/how-to-get-my-project-path ExtensionMethods.niceLayout("INITIALIZING ELEMENTS"); InitializeObjects.readDataFromTextFile(textFilePath, '\t', citylist, LongDestDeck, NormDestDeck, tracks); InitializeObjects.addTrainCards(trainCardDeck); foreach (City stad in citylist) { Program.logboek.WriteLine(stad.ToString()); ExtensionMethods.niceLayout(""); } ExtensionMethods.niceLayout("Start Game"); Program.logboek.WriteLine("SHUFFLING CARDS"); CardMethods <LongDestCard> .shuffle(LongDestDeck); Program.logboek.WriteLine("\tlong destination cards shuffled"); CardMethods <NormDestCard> .shuffle(NormDestDeck); Program.logboek.WriteLine("\tnormal destination cards shuffled"); CardMethods <TrainCard> .shuffle(trainCardDeck); Program.logboek.WriteLine("\ttraincards shuffled"); }
internal static void CheckSizeOfMainDeck(List <TrainCard> Deck) { if (Deck.Count < 5) // we add the used cards to the deck and shuffle the deck if the deck gets bigger { while (usedCardsDeck.Count > 5) { CardMethods <TrainCard> .swapCardFromDeck(usedCardsDeck, Deck); } CardMethods <TrainCard> .shuffle(Deck); } }