/// <summary> /// Method invoked when manager receives stop command /// </summary> /// <param name="stop">Received stop command</param> private void OnStopCommand(Commands.Stop stop) { if (Loader.Instance.CurrentSimulation != null && State != SimulationState.Initial) { Loader.StopAsync(); } State = SimulationState.Initial; }
/// <summary> /// Method invoked when manager receives stop command /// </summary> /// <param name="stop">Received stop command</param> private void OnStopCommand(Commands.Stop stop) { if (Loader.Instance.CurrentSimulation == null || State == SimulationState.Initial) { return; } Log.Info($"{GetType().Name} received stop command and stops the simulation."); State = SimulationState.Stopping; Loader.StopAsync(); }
/// <summary> /// Method invoked when manager receives stop command /// </summary> /// <param name="stop">Received stop command</param> private void OnStopCommand(Commands.Stop stop) { var simulation = Loader.Instance.Network.CurrentSimulation; if (State == SimulationState.Initial || State == SimulationState.Stopping || simulation == null || simulation.Id != stop.SimulationId) { return; } Log.Info($"{GetType().Name} received stop command and stops the simulation."); State = SimulationState.Stopping; Loader.Instance.StopAsync(); }