using System;
using System.Collections.Generic;
using AcDream.Core.Physics;
using DatReaderWriter.DBObjs;
using DatReaderWriter.Enums;
using DatReaderWriter.Types;
using Xunit;
namespace AcDream.Core.Tests.Physics;
///
/// Guards the DAT-only shape-source rule (Slice 1 of the unified
/// collision-inclusion phase, 2026-06-24).
///
///
/// Retail oracle: CPartArray::InitParts@0x00517F40 (parts come from
/// the Setup list only), CGfxObj::Serialize@0x00534970 (physics_bsp
/// gated on serialized-flags bit-0), CPhysicsPart::find_obj_collisions@0x0050D8D0
/// (returns OK / passable when physics_bsp == null). Render-mesh bounds
/// never enter collision.
///
///
public class ShadowShapeBuilderShapeSourceTests
{
// Retail: an object with no DAT physics shape (no CylSphere, no Sphere,
// no part with a PhysicsBSP) emits NO collision shape and is passable.
// CPhysicsPart::find_obj_collisions@0x0050D8D0 returns OK when physics_bsp==null.
[Fact]
public void Setup_WithNoCylSpheres_NoSpheres_NoPhysicsBspParts_YieldsEmptyShapeList()
{
var setup = new Setup
{
CylSpheres = new List(),
Spheres = new List(),
Parts = { 0x01000ABCu },
PlacementFrames = new Dictionary(),
};
var shapes = ShadowShapeBuilder.FromSetup(setup, entScale: 1f, hasPhysicsBsp: _ => false);
Assert.Empty(shapes);
}
}