Persist item enabled state in typed snapshots
This commit is contained in:
parent
ee60d1d5d3
commit
f785f8e350
10 changed files with 58 additions and 18 deletions
|
|
@ -185,7 +185,8 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
{
|
||||
ItemKey = AetheriaCatalogKeys.ItemDefinitionFromLegacyId(itemLegacyId).ToString(),
|
||||
Quality = 0.95,
|
||||
Durability = 0.8
|
||||
Durability = 0.8,
|
||||
Enabled = false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -209,7 +210,8 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
ItemKey = AetheriaCatalogKeys.ItemDefinitionFromLegacyId(itemLegacyId).ToString(),
|
||||
Quality = 0.9,
|
||||
Durability = 0.8,
|
||||
Quantity = 1
|
||||
Quantity = 1,
|
||||
Enabled = false
|
||||
}
|
||||
],
|
||||
CargoContents =
|
||||
|
|
@ -609,6 +611,7 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether
|
|||
|
||||
if (loadout?.RootEntity.Hull.ItemKey != AetheriaCatalogKeys.ItemDefinitionFromLegacyId(itemLegacyId).ToString() ||
|
||||
loadout.RootEntity.Equipment.Length != 1 ||
|
||||
loadout.RootEntity.Equipment[0].Item.Enabled ||
|
||||
loadout.RootEntity.WeaponGroups.Length != 1)
|
||||
{
|
||||
throw new InvalidOperationException("Loadout template did not survive flush/reopen.");
|
||||
|
|
@ -646,6 +649,7 @@ 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.Equipment[0].Enabled ||
|
||||
entitySnapshot.CargoContents.Length != 1 ||
|
||||
entitySnapshot.CargoContents[0].Items[0].Item.Quantity != 7 ||
|
||||
entitySnapshot.DockingBayAssignments.Length != 1 ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue