refactor(world): extract live projection mechanics
Move appearance rebinding, collision construction, default-pose resolution, local shadow ownership, and exact leave-world presentation into focused owners. Preserve retail parent ordering with staged validation, committed recovery, recursive attached-subtree withdrawal, and retryable exact teardown across parent, pickup, position, unwield, and pose-loss edges. Co-Authored-By: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
c87bac31a0
commit
69a2ca0c6d
26 changed files with 4172 additions and 430 deletions
|
|
@ -0,0 +1,51 @@
|
|||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using AcDream.App.Physics;
|
||||
using AcDream.App.Rendering;
|
||||
using AcDream.App.World;
|
||||
|
||||
namespace AcDream.App.Tests.World;
|
||||
|
||||
public sealed class GameWindowLiveEntityCompositionTests
|
||||
{
|
||||
private const BindingFlags PrivateImplementation =
|
||||
BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic;
|
||||
|
||||
[Theory]
|
||||
[InlineData("RegisterLiveEntityCollision")]
|
||||
[InlineData("MotionTableDefaultPose")]
|
||||
[InlineData("LeaveWorldLiveEntityRuntimeComponents")]
|
||||
[InlineData("WithdrawLiveEntityWorldProjection")]
|
||||
[InlineData("RebindAnimatedEntityForAppearance")]
|
||||
public void GameWindow_DoesNotReacquireExtractedLiveEntityBodies(string methodName)
|
||||
{
|
||||
Assert.Null(typeof(GameWindow).GetMethod(methodName, PrivateImplementation));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GameWindow_DoesNotOwnAnAppearanceUpdateStateType()
|
||||
{
|
||||
Assert.Null(typeof(GameWindow).GetNestedType(
|
||||
"AppearanceUpdateState",
|
||||
BindingFlags.NonPublic));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(typeof(LiveEntityCollisionBuilder))]
|
||||
[InlineData(typeof(LiveEntityDefaultPoseResolver))]
|
||||
[InlineData(typeof(LiveEntityProjectionWithdrawalController))]
|
||||
[InlineData(typeof(LocalPlayerShadowState))]
|
||||
[InlineData(typeof(LiveEntityAppearanceBinding))]
|
||||
public void ExtractedHelpers_DoNotOwnGuidIndexesOrBackendState(Type helperType)
|
||||
{
|
||||
foreach (FieldInfo field in helperType.GetFields(
|
||||
BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic))
|
||||
{
|
||||
Assert.False(typeof(IDictionary).IsAssignableFrom(field.FieldType),
|
||||
$"{helperType.Name}.{field.Name} must resolve identity through LiveEntityRuntime.");
|
||||
string typeName = field.FieldType.FullName ?? field.FieldType.Name;
|
||||
Assert.DoesNotContain("Silk.NET", typeName, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("OpenGL", typeName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue