public void ProcessEventForFSD(JournalEvent journalEvent) { switch (journalEvent.@event) { case EventType.StartJump: StartJump startJump = (StartJump)journalEvent; if (startJump.JumpType == JumpType.Hyperspace) { fsdState = FSDState.CountdownHyperspace; try { jumpStarClass = (StarClass)Enum.Parse(typeof(StarClass), startJump.StarClass, true); } catch (Exception e) { jumpStarClass = StarClass.K; } } else { fsdState = FSDState.CountdownSupercruise; jumpStarClass = StarClass.None; SetFsdWaitingSupercruise(true); } SetFsdWaitingCooldown(true); fsdChargeStartTime = Utils.Time.GetMillisecondsSinceEpoch(); break; case EventType.SupercruiseEntry: ResetFsd(); SetFsdWaitingCooldown(false); break; case EventType.SupercruiseExit: ResetFsd(); SetFsdWaitingCooldown(true); break; case EventType.FSDJump: ResetFsd(); SetFsdWaitingCooldown(true); ExitStarClass = jumpStarClass; break; case EventType.Music: if (fsdState == FSDState.CountdownHyperspace && ((Music)journalEvent).MusicTrack.Equals("NoTrack")) { ResetFsd(); fsdState = FSDState.InHyperspace; } break; } }
private void ResetFsd() { fsdState = FSDState.Idle; fsdChargeStartTime = -1; }