adding manager to every person
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,11 @@ namespace PeopleVille.WorldBuilder
|
||||
|
||||
World IWorldBuilder.Build()
|
||||
{
|
||||
foreach (var person in world.People)
|
||||
{
|
||||
person.Manager = world.manager;
|
||||
}
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user