public static Metronome GetInstance() { if (_instance == null) { _instance = new Metronome(); } return(_instance); }
public void CleanupMetronome() { SetRunnable(false); Thread.Sleep(1500); //give thread enough time to gracefully stop. if (_timerThread != null) { if (_timerThread.IsAlive) { _timerThread.Abort(); } _timerThread = null; } _instance = null; }
public void Stop() { //EventCommunicator.SendSimStopEvent(); //handshakeManagerThread.Abort(); if (coordinatorThread != null) { coordinatorThread.Abort(); } if (eCommReceiver != null) { eCommReceiver.Abort(); } //textChatServerThread.Abort(); HappeningList.Happenings.Clear(); TimerQueueClass.Clear(); IncomingList.Clear(); Genealogy.Clear(); StatesForUnits.Clear(); UnitFacts.CurrentUnitStates.Clear(); UnitFacts.ClearDMTables(); UnitFacts.Data.Clear(); ChatRooms.DropAllRooms(); VoiceChannels.DropAllChannels(); WhiteboardRooms.DropAllRooms(); TimerControl((int)TimerControls.Reset); // ScenarioToQueues.Reset(); WeaponTable.Clear(); NetworkTable.Clear(); SubplatformRecords.Clear(); Engrams.Clear(); Scores.Clear(); DebugLogger.StopLogging(); NameLists.Clear(); DecisionMakerType.ClearDMTable(); SpeciesType.ClearSpeciesTable(); Metronome.GetInstance().CleanupMetronome(); }
public void CleanupMetronome() { SetRunnable(false); Thread.Sleep(1500); //give thread enough time to gracefully stop. if (_timerThread != null) { if (_timerThread.IsAlive) { _timerThread.Abort(); } _timerThread = null; } _instance = null; }
public static Metronome GetInstance() { if (_instance == null) { _instance = new Metronome(); } return _instance; }