Ejemplo n.º 1
0
 private void DrawHumans()
 {
     Humans.ForEach(e =>
     {
         Graphics.Draw(e);
     });
 }
Ejemplo n.º 2
0
 private void InfektionVerbreiten()
 {
     Humans.FindAll(e => e.Infected).ForEach(e =>
     {
         Humans.ForEach(all =>
         {
             if (Distance(all, e) <= InfectionRadius)
             {
                 all.Infect();
             }
         });
     });
 }
Ejemplo n.º 3
0
        private void SimulateDays()
        {
            while (Humans.FindAll(e => e.Alive).Count > 0)
            {
                Console.Clear();

                Humans.ForEach(e => {
                    e.SimulateDay();
                    e.Move(this);
                });

                InfektionVerbreiten();

                var healthy  = Humans.FindAll(e => !e.Infected).Count;
                var infected = Humans.FindAll(e => e.Infected).Count;
                var imune    = Humans.FindAll(e => e.Imune).Count;
                var dead     = Humans.FindAll(e => !e.Alive).Count;

                Graphics.DrawStatusBar(SimulationDay, healthy, infected, imune, dead);
                SimulationDay++;
                DrawHumans();
                Thread.Sleep(RunTimeConfig.DayDurationMS);
            }
        }