public void Start() { lock (syncObject) { if(State == TimeManagerState.Stopped) { timer.Reset(); timer.Start(); Update(); State = TimeManagerState.Running; log.Info("Started with {0}ms tick accuracy", SimulationStepSize); } else if(State == TimeManagerState.Paused) { timer.Start(); Update(); State = TimeManagerState.Running; log.Info("Resumed"); } } }
public void Stop() { lock (syncObject) { if (State != TimeManagerState.Stopped) { timer.Stop(); timer.Reset(); State = TimeManagerState.Stopped; Update(); log.Info("Stopped"); } } }
public void Pause() { lock (syncObject) { if (State == TimeManagerState.Running) { timer.Stop(); Update(); State = TimeManagerState.Paused; log.Info("Paused"); } } }