using System.Collections.Generic;
using DatReaderWriter.DBObjs;
// Environment collides with System.Environment under implicit usings — alias it.
using DatEnvironment = DatReaderWriter.DBObjs.Environment;
namespace AcDream.Core.World;
///
/// Parsed DAT closure produced by LandblockBuildFactory under the shared
/// reader gate and consumed by the render-thread presentation publishers.
/// Publication makes zero DatCollection calls, so the update thread never
/// blocks on worker DAT access. Entries retain their original DAT IDs.
///
public sealed record PhysicsDatBundle(
LandBlockInfo? Info,
IReadOnlyDictionary EnvCells,
IReadOnlyDictionary Environments,
IReadOnlyDictionary Setups,
IReadOnlyDictionary GfxObjs)
{
/// Empty bundle for far-tier landblocks (no cells / buildings /
/// entities) and for non-streaming construction.
public static readonly PhysicsDatBundle Empty = new(
null,
new Dictionary(),
new Dictionary(),
new Dictionary(),
new Dictionary());
///
/// Drops parsed collision-bearing GfxObj and Environment/CellStruct graphs
/// after their immutable package assets have been resolved. The remaining
/// records are the small publication facts still consumed by building,
/// placement, and static-light owners.
///
public PhysicsDatBundle WithoutCollisionGraphs() => new(
Info,
EnvCells,
Empty.Environments,
Setups,
Empty.GfxObjs);
}