From c14c23f394cc746b85d9103261c23560b7c5ac7a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 09:44:55 +0100 Subject: [PATCH] Select behavior configs by typed kind --- .voidbot/state/aetheria.cc | Bin 84712 -> 84482 bytes .../AetheriaRuntimeItemCatalog.cs | 66 +++++++++--------- docs/aetheria-perfect-machine-map.md | 11 ++- 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index ce6050a150d8318f421103320e5f342c7f1e8fe4..d88d87ec184482fe68802e296f39a31b11fe6266 100644 GIT binary patch delta 1193 zcmah}&ui2`6lQ8G{efB$`(vf{Sx{8Escp7hw`yyPP{b-$R)ylB(_}Ucn`F|->`Fu_ zwcte%YP56mP(%f>Qial^c&OmTt5m&s6Fi82fZ$|zlWo0tO7imNeeZqWH}A*ey1S3+ zR-e~2rc#5ws?wiHPcEYU!A8yfN@U=KT8hvex8g`Sr@pqcCbO|{taklaExLSUy(@+0 z8iU2R9pe6R)UYRSI(ky0PR=xvHg?5q0^OJx%M#nA3^O05$qX)$K_YpT6H~$GKKH9M=YXo4_LwBrcJ87M6H*r zodS~sBQ`c24_xe96zkwJS|kp3Gy*wBZQv5nPM8M6oyA2B^BShP-`v7Lc#p_g!tKmcFk3J*NII_+;9qZOjMOeO(rFSxPNrc)9%GKa~D4VolTdJ?9YsT)K*=tU32Xd9yA7cYm#(*Zkr)$#H>w8eRO z0kFfb6YNS0#(aC&cCE-grMplWA~-wr0j0&)K6Ich%1(yrY`J#9-rt=)glJg{ABDs@kd1ou{?wh|8w}wFlvt$L|-ag w8KP+zy^BMc$`;uvehniUh1Jq>5qHj_`TFt(8c>7ZJ6hK}M$r3)I4d*x7qEV&vj6}9 delta 1415 zcmZ`(O>7%Q6xPHEYAUq~irS!1HLsvlY0}-ewqu;Aj`@j*5TS$!E+Gfc?v8hdtY^&5 z7}r%rREh)wfdpF^ZX7636%Zf}kpPJk;)pn*AaUTvwI^$Nl7C9GW?b7mX>Kf# zv0})TR`#cENO|)QvQ>XV3e|2>CuGTgD^yea@wA(&0~H?Bkmm;1jO;vRe$+jOrJ?Z=m71U>uy~=d@bJh_VAZJxS51oL!0XS_Q zdde)6$(bGLyu@6sK#H&nR0HY;8G1Np&yQFBT#-0gL&Uhyk@VW`fw{d`Kvlp8Oi=*ZrCHCz zQ%D2FrvBaaDrWLDIn5&03MuwXEWsu%8KHF0-4^q#7VUl`niA(*Fpc! zeJ2_;@sKlR-=@M1WVFE=DvqzcI1_jG#^TY!*vwpJ>wZ z`SIbQl@0SwnM};3W4QuBn+y~6{~<8>99cJ&MRIJm7p}wy*?^Gw)a?%3I!r*BkMrcj zbM?rFOs#?{2-bl$_MJO@R(8z6TXVh^xkNly4$!Z>gF~V-k0$k@10m( zMGh)i_>f;g`}#qoNnPLj)YeQVJ_Sayk!%Av7zuV+gTh7l?)&N*S*YBd<2C84c^4CX z+3N4Jm4wnmvj%rX#rNNtGQV6T{;@)FX`y5(QHdOnf6G0P-N5pN-VHR<%jBm4mfl5~ eyU&c)h|KUx4>yC)#oaTHlHW& _typedItems; - private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = new Dictionary + private static readonly IReadOnlyDictionary BehaviorTypesByKind = new Dictionary(StringComparer.Ordinal) { - { 0, typeof(GuidedWeaponData) }, - { 1, typeof(LauncherData) }, - { 2, typeof(ReactorData) }, - { 3, typeof(RadiatorData) }, - { 4, typeof(StatModifierData) }, - { 5, typeof(SensorData) }, - { 6, typeof(ReflectorData) }, - { 7, typeof(ShieldData) }, - { 8, typeof(ThrusterData) }, - { 9, typeof(WearData) }, - { 10, typeof(VelocityConversionData) }, - { 11, typeof(VelocityLimitData) }, - { 12, typeof(AetherDriveData) }, - { 15, typeof(CooldownData) }, - { 16, typeof(HeatData) }, - { 18, typeof(ItemUsageData) }, - { 20, typeof(SwitchData) }, - { 21, typeof(TriggerData) }, - { 22, typeof(VisibilityData) }, - { 23, typeof(ThermotoggleData) }, - { 24, typeof(EnergyDrawData) }, - { 26, typeof(MiningToolData) }, - { 28, typeof(ResourceScannerData) }, - { 31, typeof(CapacitorData) }, - { 32, typeof(CockpitData) }, - { 33, typeof(HeatStorageData) }, - { 34, typeof(TurretControllerData) }, - { 35, typeof(InstantWeaponData) }, - { 36, typeof(ConstantWeaponData) }, - { 37, typeof(ChargedWeaponData) }, - { 38, typeof(AutoWeaponData) } + { "GuidedWeapon", typeof(GuidedWeaponData) }, + { "Launcher", typeof(LauncherData) }, + { "Reactor", typeof(ReactorData) }, + { "Radiator", typeof(RadiatorData) }, + { "StatModifier", typeof(StatModifierData) }, + { "Sensor", typeof(SensorData) }, + { "Reflector", typeof(ReflectorData) }, + { "Shield", typeof(ShieldData) }, + { "Thruster", typeof(ThrusterData) }, + { "Wear", typeof(WearData) }, + { "VelocityConversion", typeof(VelocityConversionData) }, + { "VelocityLimit", typeof(VelocityLimitData) }, + { "AetherDrive", typeof(AetherDriveData) }, + { "Cooldown", typeof(CooldownData) }, + { "Heat", typeof(HeatData) }, + { "ItemUsage", typeof(ItemUsageData) }, + { "Switch", typeof(SwitchData) }, + { "Trigger", typeof(TriggerData) }, + { "Visibility", typeof(VisibilityData) }, + { "Thermotoggle", typeof(ThermotoggleData) }, + { "EnergyDraw", typeof(EnergyDrawData) }, + { "MiningTool", typeof(MiningToolData) }, + { "ResourceScanner", typeof(ResourceScannerData) }, + { "Capacitor", typeof(CapacitorData) }, + { "Cockpit", typeof(CockpitData) }, + { "HeatStorage", typeof(HeatStorageData) }, + { "TurretController", typeof(TurretControllerData) }, + { "InstantWeapon", typeof(InstantWeaponData) }, + { "ConstantWeapon", typeof(ConstantWeaponData) }, + { "ChargedWeapon", typeof(ChargedWeaponData) }, + { "AutoWeapon", typeof(AutoWeaponData) } }; public AetheriaRuntimeItemCatalog(AetheriaRuntimeCatalogSnapshot catalog) @@ -95,7 +95,7 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader private static BehaviorData BuildBehaviorConfig(AetheriaRuntimeBehaviorPayload payload) { - if (!BehaviorTypesByUnionKey.TryGetValue(payload.UnionKey, out var behaviorType)) + if (!BehaviorTypesByKind.TryGetValue(payload.Kind, out var behaviorType)) { return null; } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 27236fed4..2522547f5 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -529,9 +529,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. interface for this bridge is named `IRuntimeItemCatalogReader` so callers see typed catalog row ownership rather than old DTO projection ownership. Behavior type selection now uses an explicit runtime catalog map instead of - `UnionAttribute` reflection. Runtime item category classification uses - package-owned `AetheriaRuntimeItemCategories` tokens; gameplay code should not - ask C# legacy DTO class names to classify typed catalog rows. + `UnionAttribute` reflection, and the temporary behavior config constructor + map is keyed by typed behavior payload kind rather than legacy union key. + Runtime item category classification uses package-owned + `AetheriaRuntimeItemCategories` tokens; gameplay code should not ask C# + legacy DTO class names to classify typed catalog rows. Item/behavior DTO field layout for the temporary projection bridge is now marked with project-owned `LegacyPayloadKeyAttribute`, not MessagePack metadata. Item properties @@ -786,6 +788,9 @@ First Aetheria surfaces to publish: off `Data.Behaviors` and onto typed runtime behavior payload config construction; `BehaviorData` remains only the temporary behavior-class config bridge. + - Done: move the temporary behavior config constructor map from legacy union + keys to typed behavior payload kind strings; union keys remain migration + provenance only for this runtime path. - Done: move `StatModifier` behavior requirements and behavior-stat targets off `EquippableItemData.Behaviors` and onto typed runtime behavior config; the obsolete item-DTO stat target branch is deleted because the live