Example #1
0
        public static Metronome GetInstance()
        {
            if (_instance == null)
            {
                _instance = new Metronome();
            }

            return(_instance);
        }
Example #2
0
 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;
 }
Example #3
0
 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();
 }
Example #4
0
 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;
 }
Example #5
0
        public static Metronome GetInstance()
        {
            if (_instance == null)
            {
                _instance = new Metronome();
            }

            return _instance;
        }