コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
ファイル: ClientManager.cs プロジェクト: lgsvl/simulator
        /// <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();
        }