示例#1
0
        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;
        }
示例#2
0
        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;
                }
            }
        }
示例#3
0
 public Doctor(int id, int homeId, CityMap map, PersonHealthStatus healthStatus) : base(id, homeId, map, healthStatus)
 {
     this.PersonType = PersonType;
 }
示例#4
0
 public Doctor(int id, int homeId, CityMap map, PersonHealthStatus healthStatus, int age) : base(id, homeId, map, healthStatus, age)
 {
 }
示例#5
0
 public Person(int id, int homeId, CityMap map, PersonHealthStatus healthStatus) : this(id, homeId, map,
                                                                                        healthStatus, random.Next(minAge, maxAge))
 {
 }