Pin CultLib abd1a92e: element ids on every list element type, tests follow the new wire and write rules
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2c087bf2b0
commit
ff54fe7b46
33 changed files with 251 additions and 27 deletions
|
|
@ -6,6 +6,7 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GameCult.Caching;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
using CultMath;
|
||||
|
|
@ -212,4 +213,7 @@ public abstract class BehaviorData
|
|||
{
|
||||
return base.ToString().FormatTypeName();
|
||||
}
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(37)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
|
@ -84,5 +84,8 @@ public class FactionPlace
|
|||
// treats an invalid entry as absent; AetherDb place-names refuses a table that holds one.
|
||||
public static bool IsValidName(string name) =>
|
||||
!string.IsNullOrEmpty(name) && name == name.Trim() && !name.StartsWith("EAC-", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -294,4 +294,7 @@ public abstract class EntityPack
|
|||
|
||||
return _price;
|
||||
}
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(23)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ public class ProductRole
|
|||
|
||||
[Inspectable, JsonProperty("standardDeviation"), Key(2)]
|
||||
public float StandardDeviation = .15f;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(3)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// A bin of one of the maker's lines (ruling maker-design-tiers-allowed): the line it bins (the same design and maker, itself
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@ public class InputLayout
|
|||
Union(0, typeof(InputLayoutRowSpacer)),
|
||||
Union(1, typeof(InputLayoutKeyRow))
|
||||
]
|
||||
public abstract class InputLayoutRow { }
|
||||
public abstract class InputLayoutRow {
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(1)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class InputLayoutRowSpacer : InputLayoutRow
|
||||
|
|
@ -52,6 +55,9 @@ public class InputLayoutKeyRow : InputLayoutRow
|
|||
public abstract class InputLayoutColumn
|
||||
{
|
||||
[Key(0), JsonProperty("width")] public float Width;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(5)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
|
|||
|
|
@ -348,6 +348,9 @@ public class ItemRole
|
|||
|
||||
[Inspectable, JsonProperty("count"), Key(1)]
|
||||
public int Count = 1;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[CultDocument("aetheria.compoundcommoditydata", "1"), Inspectable, MessagePackObject]
|
||||
|
|
@ -635,6 +638,9 @@ public class HardpointData
|
|||
}
|
||||
|
||||
private static Dictionary<HardpointType, float3> _tintColors;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(8)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// What a PerformanceStat reads to resolve one number: the lot it prices quality against, and the per-context
|
||||
|
|
@ -680,6 +686,9 @@ public class StatTerm
|
|||
// The design role whose part quality this term reads; unset reads the item's effective quality (Lot.EffectiveQuality).
|
||||
// Njordr states the same rule as a derivation over dimensions; this is that rule with one dimension.
|
||||
[Inspectable, JsonProperty("role"), Key(2)] public string Role;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(3)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ public class LoadoutSlot
|
|||
[Key(1)] public ItemRotation Rotation;
|
||||
[Key(2)] public CultRecordRef<EquippableItemData> Design;
|
||||
[Key(3)] public CultRecordRef<FactionProductData> Product; // unset: design-only, chosen at materialization
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(4)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// Why a faction has no boss Loadout to build; see Loadouts.BossOf.
|
||||
|
|
|
|||
|
|
@ -92,6 +92,9 @@ public class Lot
|
|||
foreach (var fill in Roles) sum += Math.Min(fill.Quality, Quality);
|
||||
return sum / Roles.Count;
|
||||
}
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(5)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// One filled slot: the design's role name and how good the part that went into it turned out to be. Stats read it through
|
||||
|
|
@ -101,6 +104,9 @@ public class RoleFill
|
|||
{
|
||||
[Key(0)] public string Role;
|
||||
[Key(1)] public float Quality;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// Who built a lot, where, and from what. Terminus mints Attributed placeholders; Produced and Extracted are the
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@ public class CommodityCount
|
|||
|
||||
[JsonProperty("count"), Key(1)]
|
||||
public int Count = 1;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// A region gate's trade with the world beyond it: what the outside buys and sells, at what price and at most how fast.
|
||||
|
|
@ -96,6 +99,9 @@ public class OutsideMarketRow
|
|||
|
||||
[JsonProperty("ratePerHour"), Key(4)]
|
||||
public float RatePerHour;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(5)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// The one reader of recipes: which recipe makes a good, a recipe's role slots (RoleInputsOf), which commodities fill a role, and
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ public class SavedStanding
|
|||
|
||||
[Key(1)]
|
||||
public FactionRelationship Relationship;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
@ -88,6 +91,9 @@ public class SavedProvince
|
|||
|
||||
[Key(1)]
|
||||
public CultRecordRef<ProvinceData> Type;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// The run's lifecycle over the run store. Only Commit creates SavedGame, SavedZone and ProvenanceLedger records;
|
||||
|
|
@ -301,6 +307,9 @@ public class SavedZone
|
|||
]
|
||||
public abstract class SavedActionBarBinding
|
||||
{
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public sealed class ShipJoint
|
|||
[Key(2)] public float[] Axes;
|
||||
[Key(3)] public float[] Min;
|
||||
[Key(4)] public float[] Max;
|
||||
|
||||
// Element identity, derived from the bone id so it never changes across rewrites.
|
||||
[Key(5)] [CultElementId(nameof(Id))] public string ElementId = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
@ -50,6 +53,9 @@ public sealed class ShipAnchor
|
|||
[Key(4)] public int Order;
|
||||
// On a weapon-mount anchor: the id of the nearest joint above its node in the model; null or empty is a fixed mount.
|
||||
[Key(5)] public string Joint;
|
||||
|
||||
// Element identity, derived from the anchor id so it never changes across rewrites.
|
||||
[Key(6)] [CultElementId(nameof(Id))] public string ElementId = "";
|
||||
}
|
||||
|
||||
// Evaluated or baked Grease Pencil stroke coordinates in Blender's right-handed Z-up
|
||||
|
|
@ -64,6 +70,9 @@ public sealed class ShipPolyline
|
|||
[Key(4)] public float[] Opacities;
|
||||
[Key(5)] public bool Cyclic;
|
||||
[Key(6)] public float[] Color;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(7)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
public static class ShipAuthoringStore
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ public class StationKindStandIn
|
|||
// The kind whose model this faction builds in place of the owning kind's.
|
||||
[JsonProperty("kind"), Key(1)]
|
||||
public CultRecordRef<StationKindData> Kind;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// The one owner of which kinds a faction builds, which kind a station gets, and which hull kind stands in.
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ public class VerseRole
|
|||
{
|
||||
[Key(1)] public string Name;
|
||||
[Key(2)] public VerseReferentKind Binds;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(3)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// The actor is the invoking subject and is never a role.
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ public class ChunkWearPack
|
|||
|
||||
[JsonProperty("brokenUntil"), Key(3)]
|
||||
public double? BrokenUntil;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(4)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
@ -149,6 +152,9 @@ public class FieldYield
|
|||
|
||||
[JsonProperty("regional"), Key(2)]
|
||||
public bool Regional;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(3)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// Ore geography (rulings provinces-within-regions, ores-are-regional): a kind of ground, authored. A region deals its
|
||||
|
|
@ -182,6 +188,9 @@ public class ProvinceKindWeight
|
|||
|
||||
[JsonProperty("weight"), Key(1)]
|
||||
public float Weight = 1;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
@ -192,6 +201,9 @@ public class ProvinceOre
|
|||
|
||||
[JsonProperty("weight"), Key(1)]
|
||||
public float Weight = 1;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(2)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
// Mining Cut 3 (Q16 B): the one owner of which kind a belt is. Ore geography: and of what it yields.
|
||||
|
|
@ -485,6 +497,9 @@ public class Asteroid
|
|||
|
||||
[JsonProperty("rotationSpeed"), Key(3)]
|
||||
public float RotationSpeed;
|
||||
|
||||
// Element identity: minted by the cache on write; "" means unset.
|
||||
[Key(4)] [CultElementId] public string Id = "";
|
||||
}
|
||||
|
||||
[CultDocument("aetheria.orbitdata", "1"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue