Initial import of IC.Rebuild

This commit is contained in:
2026-10-13 22:55:05 +08:00
commit 16d61f7a5e
87 changed files with 17054 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
namespace ICRebuild.Core;
// Session state only. Editing the saved preset never changes the applied height.
public sealed class HeightActivation
{
private float applied;
public float Applied => Volatile.Read(ref applied);
public bool IsApplied => Applied!=0;
public float Toggle(bool moduleEnabled,float preset)
{
if(!moduleEnabled || IsApplied) { Reset(); return 0; }
var next=Policies.FiniteClamp(preset,-10,10);
Volatile.Write(ref applied,next);
return next;
}
public void Reset() => Volatile.Write(ref applied,0);
}