示例#1
0
        public void PrintSimulation()
        {
            //Initialisieren der Objekte
            TextLog    logger    = new TextLog();
            Simulation simulator = new Simulation();
            Stock      stock     = new Stock();

            Console.WriteLine("\nSimulation wird gestartet: \n");

            logger.InitializeLogger();

            for (int i = 1; i < 6; i++)
            {
                logger.SetLogFilePath("Log-" + simulator.GetSimulationDate().ToString("dd/MM/yyyy"));
                logger.CreateLogFile();

                Console.WriteLine("\nSimuliere Tag: " + i + "\n");

                simulator.SimulateADay();
                simulator.IncrementDate();

                logger.EndLoggersWorkDay();

                stock.CalculateDailyEarnings();
                stock.PrintStock();

                stock.ReOrder();

                Console.WriteLine("\nTag: " + i + " beendet.\n");
            }
        }