mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2025-12-15 11:03:32 +08:00
WIP
This commit is contained in:
@@ -139,60 +139,12 @@ public class CruiseAssistPlugin : BaseUnityPlugin
|
||||
public static CruiseAssistState State = CruiseAssistState.Inactive;
|
||||
public static bool Interrupt = false;
|
||||
public static int Seed = -1;
|
||||
public static List<int> History = [];
|
||||
public static List<int> HistoryDistinct = [];
|
||||
public static List<int> Bookmark = [];
|
||||
public static HashSet<int> BookmarkSet = [];
|
||||
public static readonly Func<StarData, string> GetStarName = star => star.displayName;
|
||||
public static readonly Func<PlanetData, string> GetPlanetName = planet => planet.displayName;
|
||||
internal static readonly List<ICruiseAssistExtensionAPI> Extensions = [];
|
||||
private Harmony _harmony;
|
||||
private static bool _initialized;
|
||||
|
||||
public static void AddHistory(int id)
|
||||
{
|
||||
if (History.Count >= 128)
|
||||
{
|
||||
History.RemoveAt(0);
|
||||
}
|
||||
History.Add(id);
|
||||
HistoryDistinct = Enumerable.Reverse(History).Distinct().ToList();
|
||||
}
|
||||
|
||||
public static void RemoveHistoryAt(int index)
|
||||
{
|
||||
History.RemoveAt(index);
|
||||
HistoryDistinct = Enumerable.Reverse(History).Distinct().ToList();
|
||||
}
|
||||
|
||||
public static void ClearHistory()
|
||||
{
|
||||
History.Clear();
|
||||
HistoryDistinct.Clear();
|
||||
}
|
||||
|
||||
public static bool HasBookmark(int id) => BookmarkSet.Contains(id);
|
||||
|
||||
public static bool AddBookmark(int id)
|
||||
{
|
||||
if (!BookmarkSet.Add(id)) return false;
|
||||
Bookmark.Add(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool RemoveBookmark(int id)
|
||||
{
|
||||
if (!BookmarkSet.Remove(id)) return false;
|
||||
Bookmark.Remove(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void ClearBookmark()
|
||||
{
|
||||
Bookmark.Clear();
|
||||
BookmarkSet.Clear();
|
||||
}
|
||||
|
||||
public static class Conf
|
||||
{
|
||||
public static bool MarkVisitedFlag = true;
|
||||
|
||||
Reference in New Issue
Block a user