public Person(int id, int homeId, CityMap map, PersonHealthStatus healthStatus, int age)
        {
            Id           = id;
            HomeId       = homeId;
            HealthStatus = healthStatus;

            var homeCoords = map.Houses[homeId].Coordinates.LeftTopCorner;

            houseCoordinates = map.Houses[homeId].Coordinates;
            var x = homeCoords.X + random.Next(HouseCoordinates.Width);
            var y = homeCoords.Y + random.Next(HouseCoordinates.Height);

            Position = new Vec(x, y);
            Age      = age;
        }
        private void UpdateHealthStatus(int currentTick)
        {
            if (HealthStatus == PersonHealthStatus.Ill)
            {
                if (random.NextBoolWithChance(3, 100000))
                {
                    HealthStatus = PersonHealthStatus.Dead;
                    deadAtTick   = currentTick;
                }

                illTick++;
                if (illTick >= CureTime)
                {
                    HealthStatus = PersonHealthStatus.Healthy;
                }
            }
        }
Beispiel #3
0
 public Doctor(int id, int homeId, CityMap map, PersonHealthStatus healthStatus) : base(id, homeId, map, healthStatus)
 {
     this.PersonType = PersonType;
 }
Beispiel #4
0
 public Doctor(int id, int homeId, CityMap map, PersonHealthStatus healthStatus, int age) : base(id, homeId, map, healthStatus, age)
 {
 }
 public Person(int id, int homeId, CityMap map, PersonHealthStatus healthStatus) : this(id, homeId, map,
                                                                                        healthStatus, random.Next(minAge, maxAge))
 {
 }