Persist entity cargo contents in typed snapshots

This commit is contained in:
Meta Vens 2026-06-14 15:32:41 +01:00
commit d462ec6942
10 changed files with 119 additions and 4 deletions

View file

@ -212,6 +212,25 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
Quantity = 1
}
],
CargoContents =
[
new AetheriaCargoBayLoadout
{
Items =
[
new AetheriaLoadoutItemSlot
{
Position = new AetheriaGridCoord { X = 2, Y = 3 },
Item = new AetheriaLoadoutItem
{
ItemKey = AetheriaCatalogKeys.ItemDefinitionFromLegacyId(itemLegacyId).ToString(),
Quantity = 7
}
}
]
}
],
DockingBayAssignments = [-1],
WeaponGroups =
[
new AetheriaWeaponGroupSnapshot
@ -471,6 +490,10 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether
entitySnapshot.Equipment[0].Quality != 0.9 ||
entitySnapshot.Equipment[0].Durability != 0.8 ||
entitySnapshot.Equipment[0].Quantity != 1 ||
entitySnapshot.CargoContents.Length != 1 ||
entitySnapshot.CargoContents[0].Items[0].Item.Quantity != 7 ||
entitySnapshot.DockingBayAssignments.Length != 1 ||
entitySnapshot.DockingBayAssignments[0] != -1 ||
entitySnapshot.WeaponGroups.Length != 1 ||
entitySnapshot.StatGrids.Length != 1 ||
entitySnapshot.StatGrids[0].Values.Length != 4)