adding manager to every person

This commit is contained in:
2026-03-26 09:55:59 +01:00
parent 210f55e8bc
commit 75ad3da5c5
3 changed files with 8 additions and 2 deletions

View File

@@ -4,11 +4,11 @@ namespace PeopleVille.Persons
{
public class AdultCitizen : Person
{
public AdultCitizen(GameManager gameManager)
public AdultCitizen()
{
Age = RNG.Range(20, 85);
gameManager.TickDone += DoSomething;
Manager.TickDone += DoSomething;
}
public void DoSomething()

View File

@@ -16,6 +16,7 @@ namespace PeopleVille.Persons
public int Age { get; set; }
public Location CurrentLocation { get; set; }
public GameManager Manager { get; set; }
public void Walk(Location newLocation)
{

View File

@@ -60,6 +60,11 @@ namespace PeopleVille.WorldBuilder
World IWorldBuilder.Build()
{
foreach (var person in world.People)
{
person.Manager = world.manager;
}
return world;
}