private void DrawHumans() { Humans.ForEach(e => { Graphics.Draw(e); }); }
private void InfektionVerbreiten() { Humans.FindAll(e => e.Infected).ForEach(e => { Humans.ForEach(all => { if (Distance(all, e) <= InfectionRadius) { all.Infect(); } }); }); }
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); } }