@
CI / build-test (push) Failing after 1m8s

Add MrGameEng.AI utility-AI module; format codebase with CSharpier

New MrGameEng.AI module (ResponseCurve, Consideration, UtilityAction,
UtilityAi selector, Blackboard) plus CSharpier formatting applied across
the whole engine. Documents the CSharpier convention in CLAUDE.md.
@
This commit is contained in:
Leonid Pershin
2026-06-12 07:19:10 +03:00
parent 4ae730cafa
commit fd6343bd09
96 changed files with 2066 additions and 589 deletions
+20 -7
View File
@@ -22,7 +22,12 @@ public class CullingTests
{
var transform = Transform2D.At(new Vector2(50f, 50f));
var (center, _) = CullingMath.SpriteBoundingCircle(transform, 64f, 32f, new Vector2(32f, 16f));
var (center, _) = CullingMath.SpriteBoundingCircle(
transform,
64f,
32f,
new Vector2(32f, 16f)
);
Assert.Equal(new Vector2(50f, 50f), center);
}
@@ -41,7 +46,11 @@ public class CullingTests
public void BoundingCircle_RegionOverload_MatchesSizeOverload_ForUniformScale()
{
var region = new Texture2DRegion(null!, new Rectangle(0, 0, 48, 24));
var transform = new Transform2D(new Vector2(10f, 20f), rotation: 0.6f, scale: new Vector2(1.5f, 1.5f));
var transform = new Transform2D(
new Vector2(10f, 20f),
rotation: 0.6f,
scale: new Vector2(1.5f, 1.5f)
);
var origin = new Vector2(5f, 7f);
var (centerA, radiusA) = CullingMath.SpriteBoundingCircle(transform, 48f, 24f, origin);
@@ -59,16 +68,20 @@ public class CullingTests
var transform = new Transform2D(Vector2.Zero, scale: new Vector2(1f, 3f));
var (_, exact) = CullingMath.SpriteBoundingCircle(transform, 100f, 10f, Vector2.Zero);
var (_, conservative) = CullingMath.SpriteBoundingCircle(in transform, region, Vector2.Zero);
var (_, conservative) = CullingMath.SpriteBoundingCircle(
in transform,
region,
Vector2.Zero
);
Assert.True(conservative >= exact);
}
[Theory]
[InlineData(50f, 50f, true)] // inside
[InlineData(-4f, 50f, true)] // touching from the left (radius 5)
[InlineData(-20f, 50f, false)] // far left
[InlineData(50f, 130f, false)] // far below
[InlineData(50f, 50f, true)] // inside
[InlineData(-4f, 50f, true)] // touching from the left (radius 5)
[InlineData(-20f, 50f, false)] // far left
[InlineData(50f, 130f, false)] // far below
public void CircleIntersectsRect_DetectsOverlap(float x, float y, bool expected)
{
var rect = new RectF(0f, 0f, 100f, 100f);