コード例 #1
0
        public void Do(Dictionary <MyTuple <IntelItemType, long>, IFleetIntelligence> IntelItems, TimeSpan canonicalTime, Profiler profiler)
        {
            if (!Cleared)
            {
                Autopilot.Clear();
                Cleared = true;
            }
            Autopilot.Move(ObstacleMode == AvoidObstacleMode.DoNotAvoid ? Destination.Position : WaypointHelper.PlotPath(IntelItems, canonicalTime, Autopilot, Destination, IntelScratchpad, PositionScratchpad, Program, ObstacleMode));
            Autopilot.Turn(Destination.Direction);
            Autopilot.Spin(Destination.DirectionUp);
            Autopilot.Drift(Destination.Velocity);
            Autopilot.SetMaxSpeed(Destination.MaxSpeed);
            Autopilot.Reference = MoveReference;

            if (canonicalTime == TimeSpan.Zero)
            {
                Autopilot.AtWaypoint(Destination);
                Autopilot.Clear();
            }
        }
コード例 #2
0
 void GoHome(TimeSpan canonicalTime)
 {
     AgentSubsystem.AddTask(TaskType.Dock, MyTuple.Create(IntelItemType.NONE, (long)0), CommandType.Enqueue, 0, canonicalTime);
     Autopilot.Clear();
     Status = TaskStatus.Complete;
 }