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); }
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); } }
public void SetDeclaredNavigation(int shipId, SimulationTimeStamp ts, DeclaredNavigation navigation) { var key = new Tuple <SimulationTimeStamp, int>(ts, shipId); NavigationSchedule[key] = navigation; }