Exemple #1
0
        public override void Check(DateTime now)
        {
            if (Place.Acting != null)//当地块上正在进行某种活动时,不进行地块转换。
            {
                return;
            }


            if (Descriptor.Guid == forestId)
            {
                Place.CheckPoint = now;
                return;
            }


            var times = (int)(now - Place.CheckPoint).TotalMinutes / 5;//每五分钟一次改变的机会

            for (int i = 0; i < times; i++)
            {
                if (TerrainChanged(Place))
                {
                    Place.CheckPoint = Place.CheckPoint.AddMinutes(i + 1);
                    Place.Check(now);
                    return;
                }
            }

            Place.CheckPoint = Place.CheckPoint.AddMinutes(times * 5);
        }