コード例 #1
0
        public void ChangeCourseImmediate(int shipId, string timestampId, DeclaredNavigation navigation)
        {
            var currentTimeStamp = SimulationTimeStamp;

            if (currentTimeStamp.GetId() != timestampId)
            {
                return;
            }

            var turnToModify = GetOrCreateTurn(SimulationTimeStamp.TurnNumber);

            turnToModify.ImpulseProcessActions.SetDeclaredNavigation(shipId, currentTimeStamp, navigation);
        }
コード例 #2
0
 private void ExecutePlottedNavigation(Ship ship, DeclaredNavigation declaredNavigation)
 {
     if (declaredNavigation.SideSlipDirection.HasValue)
     {
         ExecuteSideSlip(ship, declaredNavigation.SideSlipDirection.Value);
     }
     else
     {
         if (declaredNavigation.NewFacing.HasValue)
         {
             ship.Position = ship.Position.WithFacing(declaredNavigation.NewFacing.Value);
             MovementMarkers.Add(new TurnMarker
             {
                 ForShipId = ship.ShipId,
                 Remaining = ship.CurrentSpeed,
                 Position  = ship.Position
             });
         }
         ExecuteStandardMovement(ship);
     }
 }
コード例 #3
0
        public void SetDeclaredNavigation(int shipId, SimulationTimeStamp ts, DeclaredNavigation navigation)
        {
            var key = new Tuple <SimulationTimeStamp, int>(ts, shipId);

            NavigationSchedule[key] = navigation;
        }