public Doom3bfgComponent(LiveSplitState state, bool isLayoutComponent)
        {
            _state = state;
            this.IsLayoutComponent = isLayoutComponent;

            this.Settings = new Doom3bfgSettings();

           _timer = new TimerModel { CurrentState = state };
           _timer.CurrentState.OnPause += timer_OnStart;

            _gameMemory = new GameMemory(this.Settings);
            _gameMemory.OnFirstLevelLoading += gameMemory_OnFirstLevelLoading;
            _gameMemory.OnPlayerGainedControl += gameMemory_OnPlayerGainedControl;
            _gameMemory.OnLoadStarted += gameMemory_OnLoadStarted;
            _gameMemory.OnLoadFinished += gameMemory_OnLoadFinished;
            _gameMemory.OnSplitCompleted += gameMemory_OnSplitCompleted;
            _gameMemory.OnRoESplitCompleted += gameMemory_OnRoESplitCompleted;
            _gameMemory.OnLostMissionSplitCompleted += gameMemory_OnLostMissionSplitCompleted;
            state.OnStart += State_OnStart;
            _gameMemory.StartMonitoring();
        }
 void gameMemory_OnRoESplitCompleted(object sender, GameMemory.SplitArea_RoE split, uint frame)
 {
     Debug.WriteLineIf(split != GameMemory.SplitArea_RoE.None, String.Format("[NoLoads] Trying to split {0}, State: {1} - {2}", split, _gameMemory.splitStatesRoE[(int)split], frame));
     if (_state.CurrentPhase == TimerPhase.Running && !_gameMemory.splitStatesRoE[(int)split] &&
         ((split == GameMemory.SplitArea_RoE.erebus1 && this.Settings.roe_erebus1) ||
         (split == GameMemory.SplitArea_RoE.erebus2 && this.Settings.roe_erebus2) ||
         (split == GameMemory.SplitArea_RoE.erebus3 && this.Settings.roe_erebus3) ||
         (split == GameMemory.SplitArea_RoE.erebus4 && this.Settings.roe_erebus4) ||
         (split == GameMemory.SplitArea_RoE.erebus5 && this.Settings.roe_erebus5) ||
         (split == GameMemory.SplitArea_RoE.erebus6 && this.Settings.roe_erebus6) ||
         (split == GameMemory.SplitArea_RoE.phobos1 && this.Settings.roe_phobos1) ||
         (split == GameMemory.SplitArea_RoE.phobos2 && this.Settings.roe_phobos2) ||
         (split == GameMemory.SplitArea_RoE.phobos3 && this.Settings.roe_phobos3) ||
         (split == GameMemory.SplitArea_RoE.phobos4 && this.Settings.roe_phobos4) ||
         (split == GameMemory.SplitArea_RoE.deltarev && this.Settings.roe_deltax) ||
         (split == GameMemory.SplitArea_RoE.hell_roe && this.Settings.roe_hell)))
     {
         Trace.WriteLine(String.Format("[NoLoads] {0} Split - {1}", split, frame));
         _timer.Split();
         _gameMemory.splitStatesRoE[(int)split] = true;
     }
 }
 void gameMemory_OnLostMissionSplitCompleted(object sender, GameMemory.SplitArea_LostMission split, uint frame)
 {
     Debug.WriteLineIf(split != GameMemory.SplitArea_LostMission.None, String.Format("[NoLoads] Trying to split {0}, State: {1} - {2}", split, _gameMemory.splitStatesLostMission[(int)split], frame));
     if (_state.CurrentPhase == TimerPhase.Running && !_gameMemory.splitStatesLostMission[(int)split] &&
         ((split == GameMemory.SplitArea_LostMission.le_enpro1 && this.Settings.lm_enpro1) ||
         (split == GameMemory.SplitArea_LostMission.le_enpro2 && this.Settings.lm_enpro2) ||
         (split == GameMemory.SplitArea_LostMission.le_underground && this.Settings.lm_underground) ||
         (split == GameMemory.SplitArea_LostMission.le_underground2 && this.Settings.lm_underground2) ||
         (split == GameMemory.SplitArea_LostMission.le_exis1 && this.Settings.lm_exis1) ||
         (split == GameMemory.SplitArea_LostMission.le_exis2 && this.Settings.lm_exis2) ||
         (split == GameMemory.SplitArea_LostMission.le_hell && this.Settings.lm_hell) ||
         (split == GameMemory.SplitArea_LostMission.le_hell_post && this.Settings.lm_hell_post)))
     {
         Trace.WriteLine(String.Format("[NoLoads] {0} Split - {1}", split, frame));
         _timer.Split();
         _gameMemory.splitStatesLostMission[(int)split] = true;
     }
 }
 void gameMemory_OnSplitCompleted(object sender, GameMemory.SplitArea split, uint frame)
 {
     Debug.WriteLineIf(split != GameMemory.SplitArea.None, String.Format("[NoLoads] Trying to split {0}, State: {1} - {2}", split, _gameMemory.splitStatesBaseGame[(int)split], frame));
     if (_state.CurrentPhase == TimerPhase.Running && !_gameMemory.splitStatesBaseGame[(int)split] &&
         ((split == GameMemory.SplitArea.mars_city1 && this.Settings.d3_mars_city1) ||
         (split == GameMemory.SplitArea.mc_underground && this.Settings.d3_mc_underground) ||
         (split == GameMemory.SplitArea.mars_city2 && this.Settings.d3_mars_city2) ||
         (split == GameMemory.SplitArea.admin && this.Settings.d3_admin) ||
         (split == GameMemory.SplitArea.alphalabs1 && this.Settings.d3_alphalabs1) ||
         (split == GameMemory.SplitArea.alphalabs2 && this.Settings.d3_alphalabs2) ||
         (split == GameMemory.SplitArea.alphalabs3 && this.Settings.d3_alphalabs3) ||
         (split == GameMemory.SplitArea.alphalabs4 && this.Settings.d3_alphalabs4) ||
         (split == GameMemory.SplitArea.enpro && this.Settings.d3_enpro) ||
         (split == GameMemory.SplitArea.commoutside && this.Settings.d3_commoutside) ||
         (split == GameMemory.SplitArea.comm1 && this.Settings.d3_comm1) ||
         (split == GameMemory.SplitArea.recycling1 && this.Settings.d3_recycling1) ||
         (split == GameMemory.SplitArea.recycling2 && this.Settings.d3_recycling2) ||
         (split == GameMemory.SplitArea.monorail && this.Settings.d3_monorail) ||
         (split == GameMemory.SplitArea.delta1 && this.Settings.d3_delta1) ||
         (split == GameMemory.SplitArea.delta2a && this.Settings.d3_delta2a) ||
         (split == GameMemory.SplitArea.delta2b && this.Settings.d3_delta2b) ||
         (split == GameMemory.SplitArea.delta3 && this.Settings.d3_delta3) ||
         (split == GameMemory.SplitArea.delta4 && this.Settings.d3_delta4) ||
         (split == GameMemory.SplitArea.hell && this.Settings.d3_hell) ||
         (split == GameMemory.SplitArea.delta5 && this.Settings.d3_delta5) ||
         (split == GameMemory.SplitArea.cpu && this.Settings.d3_cpu) ||
         (split == GameMemory.SplitArea.cpuboss && this.Settings.d3_cpuboss) ||
         (split == GameMemory.SplitArea.site3 && this.Settings.d3_site3) ||
         (split == GameMemory.SplitArea.caverns1 && this.Settings.d3_caverns1) ||
         (split == GameMemory.SplitArea.caverns2 && this.Settings.d3_caverns2) ||
         (split == GameMemory.SplitArea.hellhole && this.Settings.d3_hellhole)))
     {
         Trace.WriteLine(String.Format("[NoLoads] {0} Split - {1}", split, frame));
         _timer.Split();
         _gameMemory.splitStatesBaseGame[(int)split] = true;
     }
 }