Ejemplo n.º 1
0
        static Map InitializeMap(int height, int width, int population, double coefficient = 0.5)
        {
            Map map = new Map(width, height);

            map.Populate(population, coefficient);

            TurnsManager.GenerateTilemap(map);

            Verbose.TurnCounter(0);
            Verbose.AnimalsAlive(map);
            Verbose.DrawMap(map);
            Verbose.PopulationCount(map);
            Console.WriteLine("");
            return(map);
        }
 public static void Run(Map map, int turns, bool debugMode = false)
 {
     for (int i = 0; i < turns; i++)
     {
         Console.WriteLine($"turn: {i+1}");
         foreach (var phase in Phases.PhasesList)
         {
             phase.Invoke(map);
             Verbose.TurnCounter(i + 1);
             Verbose.DrawMap(map);
             Verbose.PopulationCount(map);
         }
         if (debugMode)
         {
             Verbose.AnimalsAlive(map);
             Console.WriteLine("_________________");
         }
     }
 }