private static AtsHandles Elapse(AtsVehicleState vehicleState, IntPtr panel, IntPtr sound) { AtsSimulationEnvironment.Instance.OnUpdate(out var vehicleOperations, vehicleState, panel, sound); return(vehicleOperations); }
internal void OnUpdate(out AtsHandles vehicleOperations, AtsVehicleState vehicleState, IntPtr panelArray, IntPtr soundArray) { PanelOperations.SetSource(panelArray); SoundOperations.SetSource(soundArray); LastStates.CopyFrom(CurrentStates); if (WasJustInitialized) { LastStates.SetVehicleState(vehicleState); } CurrentStates.SetVehicleState(vehicleState); this.UpdateVelocityFromDeltaLocation(); ControlHandle.Update(); foreach (var behaviour in BehaviourArray) { behaviour.Update(); } LastKeyStates.CopyFrom(CurrentKeyStates); vehicleOperations = ControlHandle.Operation; WasJustInitialized = false; }
internal void OnUpdate(out AtsHandles vehicleOperations, AtsVehicleState vehicleState, IntPtr panelArray, IntPtr soundArray) { PanelOperations.SetSource(panelArray); SoundOperations.SetSource(soundArray); LastStates.CopyFrom(CurrentStates); CurrentStates.SetVehicleState(vehicleState); foreach (IAtsBehaviour behaviour in Behaviours) { behaviour.Update(); } LastKeyStates.CopyFrom(CurrentKeyStates); vehicleOperations = ControlHandle.Handles; }
internal void CopyFrom(AtsSimulationStates source) { _vehicleState = source._vehicleState; _doorState = source._doorState; }
internal void SetVehicleState(AtsVehicleState vehicleState) { _vehicleState = vehicleState; }