Пример #1
0
        public override void Act(Actor actor, WorldView world)
        {
            if (destination != null)
              {
            dx = world.Location.X < destination.X ? 1 : world.Location.X > destination.X ? -1 : 0;
            dy = world.Location.Y < destination.Y ? 1 : world.Location.Y > destination.Y ? -1 : 0;
              }

              Location newLocation = world.Location.Offset(dx, dy);

              if (world.IsAccessibleTo(newLocation, actor))
              {
            world.MoveTo(newLocation);
              }
        }