refactor: remove single-owner helpers and redundant plumbing

Return feature-only helpers to their owners, remove inactive scaffolding and duplicate state, and reuse existing calculation and UI work without changing public contracts or gameplay.

Record repository-wide coverage, justified retentions, independent reviews and validation, including baseline dashboard fixture failures.

Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
soarqin committed 2026-11-04 23:06:50 +08:00
1 parent 64a23e9772
commit e35fba88ae
60 files changed
+1094 -994

No files matched your search

@@ -1,12 +1,10 @@
using System;
using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.ModFeatures;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
[ModFeature("DysonSphereResolver")]
public static class DysonSphereResolver
{
public static (global::DysonSphere sphere, StarData star)? ResolveCurrent()
@@ -3,13 +3,11 @@ using HarmonyLib;
using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Utils;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
[ModFeature("FrameRemovalFunctions")]
public static class FrameRemovalFunctions
{
public static void RemoveAllFrames()
@@ -7,12 +7,10 @@ using static CheatEnabler.Functions.DysonSphere.GeometryHelpers;
using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModFeatures;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
[ModFeature("IllegalShellFunctions")]
public static class IllegalShellFunctions
{
private static void EnsureDysonShellMaps()
@@ -41,7 +39,7 @@ public static class IllegalShellFunctions
layer.shellCursor = 1;
}
private static void FinalizeDysonSphereChanges(global::DysonSphere sphere, DysonSphereLayer layer, bool notify = false, bool resetRenderMasks = false)
private static void FinalizeDysonSphereChanges(global::DysonSphere sphere, bool notify = false, bool resetRenderMasks = false)
{
if (sphere == null) return;
sphere.CheckAutoNodes();
@@ -140,7 +138,7 @@ public static class IllegalShellFunctions
node.RecalcSpReq();
node.RecalcCpReq();
}
FinalizeDysonSphereChanges(dysonSphere, layer, true, true);
FinalizeDysonSphereChanges(dysonSphere, true, true);
}
public static void KeepMaxProductionShells()
@@ -245,7 +243,7 @@ public static class IllegalShellFunctions
node.RecalcCpReq();
}
}
FinalizeDysonSphereChanges(dysonSphere, null);
FinalizeDysonSphereChanges(dysonSphere);
}
public static void CreateIllegalDysonShellQuickly(int triangleCount)
@@ -317,7 +315,7 @@ public static class IllegalShellFunctions
node.RecalcSpReq();
node.RecalcCpReq();
}
FinalizeDysonSphereChanges(dysonSphere, layer, true);
FinalizeDysonSphereChanges(dysonSphere, true);
return;
}
}
@@ -433,7 +431,7 @@ public static class IllegalShellFunctions
var shellsChanged = CreateIllegalDysonShellWithMaxOutputForLayer(layer);
FinalizeDysonSphereChanges(dysonSphere, layer, shellsChanged, true);
FinalizeDysonSphereChanges(dysonSphere, shellsChanged, true);
}
public static void CreateIllegalDysonShellWithMaxOutputForAllLayers()
@@ -449,7 +447,7 @@ public static class IllegalShellFunctions
shellsChanged = CreateIllegalDysonShellWithMaxOutputForLayer(layer) || shellsChanged;
}
FinalizeDysonSphereChanges(dysonSphere, dysonSphere.layersSorted.FirstOrDefault(l => l != null), shellsChanged, true);
FinalizeDysonSphereChanges(dysonSphere, shellsChanged, true);
}
public static void CreateIllegalDysonShellsSpecially()
@@ -477,8 +475,6 @@ public static class IllegalShellFunctions
for (var idx = 1; idx <= 2; idx++)
{
Dictionary<(int, int), int> availableFrames = [];
HashSet<int> unusedFrameIds = [];
var layer = dysonSphere.layersIdBased[idx];
if (layer != null)
{
@@ -571,6 +567,6 @@ public static class IllegalShellFunctions
}
}
FinalizeDysonSphereChanges(dysonSphere, dysonSphere.layersIdBased[2], shellsChanged, true);
FinalizeDysonSphereChanges(dysonSphere, shellsChanged, true);
}
}
@@ -3,13 +3,11 @@ using System.Linq;
using HarmonyLib;
using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Utils;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
[ModFeature("ShellCompletionFunctions")]
public static class ShellCompletionFunctions
{
public static void CompleteShellsInstantly()
@@ -1,11 +1,9 @@
using BepInEx.Configuration;
using CheatEnabler.Functions.DysonSphere;
using UXAssist.Common;
using UXAssist.Common.ModFeatures;
namespace CheatEnabler.Functions;
[ModFeature("CheatDysonSphere", Order = 20)]
public static class DysonSphereFunctions
{
public const int MinShellsCountForFunctions = 1;
+1 -3
View File
@@ -1,9 +1,7 @@
using Random = UnityEngine.Random;
using UXAssist.Common.ModFeatures;
namespace CheatEnabler.Functions;
[ModFeature("PlanetFunctions")]
public static class PlanetFunctions
{
public static void BuryAllVeins(bool bury)
@@ -35,4 +33,4 @@ public static class PlanetFunctions
}
GameMain.gpuiManager.SyncAllGPUBuffer();
}
}
}
@@ -2,11 +2,9 @@
using System.Linq;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModFeatures;
namespace CheatEnabler.Functions;
[ModFeature("PlayerFunctions")]
public static class PlayerFunctions
{
public static void Init()