From 32187038ebdf20696458f50616ad96a02cd1b865 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 21:48:43 +0100 Subject: [PATCH] Demote behavior construction configs --- .voidbot/state/aetheria.cc | Bin 87010 -> 86421 bytes Aetheria.State/README.md | 5 +- .../ServerShared/Behaviors/AetherDrive.cs | 8 +- .../ServerShared/Behaviors/AutoWeapon.cs | 6 +- .../ServerShared/Behaviors/Behaviors.cs | 20 ++--- .../ServerShared/Behaviors/Capacitor.cs | 8 +- .../ServerShared/Behaviors/ChargedWeapon.cs | 8 +- .../Scripts/ServerShared/Behaviors/Cockpit.cs | 8 +- .../ServerShared/Behaviors/ConstantWeapon.cs | 8 +- .../ServerShared/Behaviors/Cooldown.cs | 8 +- .../ServerShared/Behaviors/EnergyDraw.cs | 8 +- Assets/Scripts/ServerShared/Behaviors/Heat.cs | 8 +- .../ServerShared/Behaviors/HeatStorage.cs | 8 +- .../ServerShared/Behaviors/InstantWeapon.cs | 8 +- .../ServerShared/Behaviors/ItemUsage.cs | 8 +- .../ServerShared/Behaviors/Launcher.cs | 4 +- .../ServerShared/Behaviors/LockWeapon.cs | 8 +- .../ServerShared/Behaviors/MiningTool.cs | 8 +- .../ServerShared/Behaviors/Radiator.cs | 8 +- .../Scripts/ServerShared/Behaviors/Reactor.cs | 8 +- .../ServerShared/Behaviors/Reflector.cs | 8 +- .../ServerShared/Behaviors/ResourceScanner.cs | 8 +- .../Scripts/ServerShared/Behaviors/Sensor.cs | 8 +- .../Scripts/ServerShared/Behaviors/Shield.cs | 8 +- .../ServerShared/Behaviors/StatModifier.cs | 14 ++-- .../Scripts/ServerShared/Behaviors/Switch.cs | 8 +- .../ServerShared/Behaviors/Thermotoggle.cs | 10 +-- .../ServerShared/Behaviors/Thruster.cs | 8 +- .../Scripts/ServerShared/Behaviors/Trigger.cs | 6 +- .../Behaviors/TurretController.cs | 6 +- .../Behaviors/VelocityConversion.cs | 8 +- .../ServerShared/Behaviors/VelocityLimit.cs | 8 +- .../ServerShared/Behaviors/Visibility.cs | 8 +- .../Scripts/ServerShared/Behaviors/Weapon.cs | 14 ++-- Assets/Scripts/ServerShared/Behaviors/Wear.cs | 8 +- Assets/Scripts/ServerShared/ItemManager.cs | 75 +++++++++--------- .../Scripts/ServerShared/LoadoutGenerator.cs | 6 +- .../UI/Properties Panel/PropertiesPanel.cs | 2 +- docs/aetheria-perfect-machine-map.md | 47 ++++++----- 39 files changed, 209 insertions(+), 206 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 692a04a75c02a0a7cf558e5d597c9cf2cbbb591f..64ef9181771a5329e22833ddfa006a377b0d1e42 100644 GIT binary patch delta 1575 zcmaJ>TWDNG7-lv}OZ6Z`_B@Jctrsl%5JEu^L0<$P#0Q~|6$HWSi_iXZF4-XJ%d-4){{R1OGxu&y zTz_}s)AvgUmsd_bRj;iy>Ipqd%JJ8wxAsbntfa=1RY%hDfK}V9N4L4sRZqzd?EVZn5(-V{jcS{?q`D)Ni(t!ENZx4~F_|DD)!{+8i=+Jan3#eS_WqiDERk%{mIj zL_Wsq$g^B_L1ZX$5UTwu^Q@`C<{)JLNYO3CfQoADFkm9D2h<=yZ!6?OTY=3;qd*AQ zY9$2I6h?f*!O3j^LoA<>R1h765zdb+$TDF(HV z@S^pUzQj7_`Wx|Le=Vss$$_~2c|DnLlEd-$KQ@wY*U2IBbiCA`jeq~?NLIJcEF>Q{ z$)m|&gRJd-)g(J)@>z{Tae)(JCVe2%IHFi1%4uLCjdru-mklyoT5cpqT4d((a^qCJ zzF1$v-}fx-nj0S!PvnPQB&-!<(F5@y6P=4D5?D#_AYR0q;o!xSClfgO2bgd-(f6u*c6*mS>}*%ntM^|0-tYIS zzP`Qv@4MUY|1h?*eEdZDc(Hu+=!LJmJ%iuJZtTcrj#Y-Ap7!<+l5zV?HZ}Zy+Iw~I z?6%j(POW}+XxoEB+q`2(hu@aGoqMk+2@}4O#_GhkLdl7MTRx1R_de;Ly?~1>zsR)e z8pbs+xEzPV7dGr|G@#uDCY5D6kyb>&jO7*>Pi#kNVSB|@Kjb2MJl>rG+W{>&(;#^S z0i#@U-ugf&n= zTZ6S?p~9Rr)}aMh3m+WZwSErc6p1{p>C6brbcFb&9}cecGY3wAH8-EKz?63QZGlC9 z9gHG72Qp9^fjcXaL~Is};cZyp{xYT=IVd>0lyHq02#I!~>Q02P0wH1*fX|vLkpb7e zlT6^DZ7+rpeK;UB_pKXfFe+R@B&6!Hb|1Y3h9Qzk94l?nY0yKa3LitJhO`=>{oM4@ z#m3UqTy1KxcCmbM^67jVQ}r3PgnF0-ZW5iv&~Pac=!`8+FU&74otdk%76L*U2GDON zZMQ|UnA=W)Mcn!wA=}6UEMG5bsxYMl=AZBor5Hd94{zA4@U=3kWs9>2Q&_A4`uYIE z7_=!;7P@%Xf;6c2$KL(Tgw42!_~)=iQcsu;>KduH)-0HiabkJ^fG+9j;&BId3-0qdViP`=#nK#9JvtuXPF{U zIdzbrv6Thv3>~`B!{j6OVPk%d2~v?|YYojE=H&WVbxDmmN;=qFs&P!In$(%ow~v)H zMDxMw)faXJ5Q?UY8xC*1=d_T6iJcVK)!Yp zN+M%iCTYXw%(i1c`4FcCs`o^j#-IdFKBrcRgCL}5dB`9o)HOj2RMvOs5AnYNom^9V)DT3jF$Lgq@@$N2(wQ9$8$JMIQSWMgE2Rz3Sd=nuSZf9&d6V3zwW1dB<_ZGZE}@I?MX%wSXo`@Ukm-oX z6z_5Ao0}y?1;9Jt&a#lfot6mU`fcRaqc;Xm&h3ARj5jV0 zZapG5gU>sA`Z@ENDPzEz(n6TDvH6#BU9hw`YDuM~thXTn?5MRhENTv=HL}_m&gJsn zX6MwhN{a_nLhzLuc;8DXRk7jWN4vD%%Z3N5-pAg|;Nf@gKlr!mCEoB#)vF$y)NQ7) z5jc70iO1-+r?TGs;^pBlHSfS!r96C8^A7H+lut}fzBPFSe~15^@b*pLqsob((GzP-R>vH=?Q8CPF=%~roFv`tN-oZU7o}@Q~GRrckt) z<;dX4_$$L-r@h~@M^vSJgdR~hvR786{5HL^hKK9kwY4et@Otn^-FvuWG*@}&!v95r Bj_d#c diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index d84180709..fea7f376f 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -127,8 +127,9 @@ persist hull simulation grids into `AetheriaEntitySnapshot`, so values. Broader runtime object graphs, typed behavior factory construction, and behavior-private simulation state remain legacy until dedicated typed runtime documents exist. Live behavior instances expose typed behavior kind and group -through `Behavior.Kind` and `Behavior.Group`; the remaining `BehaviorData` -objects are construction configs, not runtime identity owners. +through `Behavior.Kind` and `Behavior.Group`; the remaining +`RuntimeBehaviorConfig` objects are construction configs, not runtime identity +owners. Typed name-file documents are `aetheria.name_file.v2` records. They carry the legacy ID, display name, count, compact sample names for surfaces, and the full name array needed to move `Galaxy`/Markov name generation off legacy diff --git a/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs b/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs index 1f7ceaa5b..8e0c10a60 100644 --- a/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs +++ b/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable, EntityTypeRestriction(HullType.Ship)] -public class AetherDriveData : BehaviorData +public class AetherDriveConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public float3 RotorDiameter; @@ -60,7 +60,7 @@ public class AetherDriveData : BehaviorData public class AetherDrive : Behavior { - private AetherDriveData _data; + private AetherDriveConfig _data; private float3 _axis; public float3 Thrust { get; private set; } @@ -75,13 +75,13 @@ public class AetherDrive : Behavior set => _axis = clamp(value, -1, 1); } - public AetherDrive(AetherDriveData data, EquippedItem item) : base(data, item) + public AetherDrive(AetherDriveConfig data, EquippedItem item) : base(data, item) { _data = data; Particles = data.Particles; } - public AetherDrive(AetherDriveData data, ConsumableItemEffect item) : base(data, item) + public AetherDrive(AetherDriveConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; Particles = data.Particles; diff --git a/Assets/Scripts/ServerShared/Behaviors/AutoWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/AutoWeapon.cs index 05f37d5f0..6882b9b05 100644 --- a/Assets/Scripts/ServerShared/Behaviors/AutoWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/AutoWeapon.cs @@ -5,7 +5,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class AutoWeaponData : InstantWeaponData +public class AutoWeaponConfig : InstantWeaponConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -16,8 +16,8 @@ public class AutoWeaponData : InstantWeaponData public class AutoWeapon : InstantWeapon { - public AutoWeapon(InstantWeaponData data, EquippedItem item) : base(data, item) { } - public AutoWeapon(InstantWeaponData data, ConsumableItemEffect item) : base(data, item) { } + public AutoWeapon(InstantWeaponConfig data, EquippedItem item) : base(data, item) { } + public AutoWeapon(InstantWeaponConfig data, ConsumableItemEffect item) : base(data, item) { } public override bool Execute(float dt) { diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 65d6b0dd9..d81406ee4 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -12,7 +12,7 @@ using static Unity.Mathematics.noise; public abstract class Behavior { - public BehaviorData Data { get; } + public RuntimeBehaviorConfig Config { get; } public string Kind { get; } public int Group { get; } public EquippedItem Item { get; } @@ -44,20 +44,20 @@ public abstract class Behavior } } - protected Behavior(BehaviorData data, EquippedItem item) + protected Behavior(RuntimeBehaviorConfig config, EquippedItem item) { - Data = data; - Kind = data?.Kind ?? ""; - Group = data?.Group ?? 0; + Config = config; + Kind = config?.Kind ?? ""; + Group = config?.Group ?? 0; Item = item; ItemManager = Item.ItemManager; } - protected Behavior(BehaviorData data, ConsumableItemEffect consumable) + protected Behavior(RuntimeBehaviorConfig config, ConsumableItemEffect consumable) { - Data = data; - Kind = data?.Kind ?? ""; - Group = data?.Group ?? 0; + Config = config; + Kind = config?.Kind ?? ""; + Group = config?.Group ?? 0; Consumable = consumable; ItemManager = consumable.Entity.ItemManager; } @@ -140,7 +140,7 @@ public interface IPopulationAssignment } [Inspectable] -public abstract class BehaviorData +public abstract class RuntimeBehaviorConfig { public string Kind { get; set; } = ""; diff --git a/Assets/Scripts/ServerShared/Behaviors/Capacitor.cs b/Assets/Scripts/ServerShared/Behaviors/Capacitor.cs index f3f77960b..e1cb70542 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Capacitor.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Capacitor.cs @@ -7,7 +7,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class CapacitorData : BehaviorData +public class CapacitorConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Capacity = new PerformanceStat(); @@ -28,7 +28,7 @@ public class CapacitorData : BehaviorData public class Capacitor : Behavior { - private CapacitorData _data; + private CapacitorConfig _data; public float Charge { get; private set; } public float Capacity { get; private set; } @@ -40,12 +40,12 @@ public class Capacitor : Behavior AddHeat(abs(charge) * (1-Efficiency)); } - public Capacitor(CapacitorData data, EquippedItem item) : base(data, item) + public Capacitor(CapacitorConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Capacitor(CapacitorData data, ConsumableItemEffect item) : base(data, item) + public Capacitor(CapacitorConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs index d41740293..bce5336c7 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs @@ -5,7 +5,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ChargedWeaponData : InstantWeaponData +public class ChargedWeaponConfig : InstantWeaponConfig { [Inspectable, LegacyPayloadKey(21)] public PerformanceStat ChargeTime = new PerformanceStat(); @@ -56,7 +56,7 @@ public class ChargedWeaponData : InstantWeaponData public class ChargedWeapon : InstantWeapon { - private ChargedWeaponData _data; + private ChargedWeaponConfig _data; private bool _charging; private bool _charged; private float _charge; @@ -98,12 +98,12 @@ public class ChargedWeapon : InstantWeapon public bool Charging => _charging; public bool Charged => _charged; - public ChargedWeapon(ChargedWeaponData data, EquippedItem item) : base(data, item) + public ChargedWeapon(ChargedWeaponConfig data, EquippedItem item) : base(data, item) { _data = data; } - public ChargedWeapon(ChargedWeaponData data, ConsumableItemEffect item) : base(data, item) + public ChargedWeapon(ChargedWeaponConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Cockpit.cs b/Assets/Scripts/ServerShared/Behaviors/Cockpit.cs index 22c12c205..d9b9249f7 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Cockpit.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Cockpit.cs @@ -7,7 +7,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class CockpitData : BehaviorData +public class CockpitConfig : RuntimeBehaviorConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -21,14 +21,14 @@ public class CockpitData : BehaviorData public class Cockpit : Behavior { - private CockpitData _data; + private CockpitConfig _data; - public Cockpit(CockpitData data, EquippedItem item) : base(data, item) + public Cockpit(CockpitConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Cockpit(CockpitData data, ConsumableItemEffect item) : base(data, item) + public Cockpit(CockpitConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs index 25d3fbb06..9f6a800d8 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs @@ -7,7 +7,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ConstantWeaponData : WeaponData +public class ConstantWeaponConfig : WeaponConfig { [InspectablePrefab, LegacyPayloadKey(17)] public float AmmoInterval = 1; @@ -25,7 +25,7 @@ public class ConstantWeaponData : WeaponData public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior { - private ConstantWeaponData _data; + private ConstantWeaponConfig _data; private int _ammo = 1; private float _ammoInterval; private float _reload; @@ -63,12 +63,12 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior OnStopFiring = null; } - public ConstantWeapon(ConstantWeaponData data, EquippedItem item) : base(data, item) + public ConstantWeapon(ConstantWeaponConfig data, EquippedItem item) : base(data, item) { _data = data; } - public ConstantWeapon(ConstantWeaponData data, ConsumableItemEffect item) : base(data, item) + public ConstantWeapon(ConstantWeaponConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Cooldown.cs b/Assets/Scripts/ServerShared/Behaviors/Cooldown.cs index 7e4b0efec..be046df71 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Cooldown.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Cooldown.cs @@ -8,7 +8,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable, Order(-10)] -public class CooldownData : BehaviorData +public class CooldownConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Cooldown = new PerformanceStat(); @@ -26,18 +26,18 @@ public class CooldownData : BehaviorData public class Cooldown : Behavior, IAlwaysUpdatedBehavior, IProgressBehavior { - private CooldownData _data; + private CooldownConfig _data; private float _cooldown; // Normalized public float Progress => saturate(_cooldown); - public Cooldown(CooldownData data, EquippedItem item) : base(data, item) + public Cooldown(CooldownConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Cooldown(CooldownData data, ConsumableItemEffect item) : base(data, item) + public Cooldown(CooldownConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/EnergyDraw.cs b/Assets/Scripts/ServerShared/Behaviors/EnergyDraw.cs index a82cd6051..5410c809a 100644 --- a/Assets/Scripts/ServerShared/Behaviors/EnergyDraw.cs +++ b/Assets/Scripts/ServerShared/Behaviors/EnergyDraw.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(-20)] -public class EnergyDrawData : BehaviorData +public class EnergyDrawConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat EnergyDraw = new PerformanceStat(); @@ -26,14 +26,14 @@ public class EnergyDrawData : BehaviorData public class EnergyDraw : Behavior { - private EnergyDrawData _data; + private EnergyDrawConfig _data; - public EnergyDraw(EnergyDrawData data, EquippedItem item) : base(data, item) + public EnergyDraw(EnergyDrawConfig data, EquippedItem item) : base(data, item) { _data = data; } - public EnergyDraw(EnergyDrawData data, ConsumableItemEffect item) : base(data, item) + public EnergyDraw(EnergyDrawConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Heat.cs b/Assets/Scripts/ServerShared/Behaviors/Heat.cs index 1c5cd616d..65aa04728 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Heat.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Heat.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(10)] -public class HeatData : BehaviorData +public class HeatConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Heat = new PerformanceStat(); @@ -26,13 +26,13 @@ public class HeatData : BehaviorData public class Heat : Behavior { - private HeatData _data; + private HeatConfig _data; - public Heat(HeatData data, EquippedItem item) : base(data, item) + public Heat(HeatConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Heat(HeatData data, ConsumableItemEffect item) : base(data, item) + public Heat(HeatConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/HeatStorage.cs b/Assets/Scripts/ServerShared/Behaviors/HeatStorage.cs index bf2c5988e..df6b3d8bb 100644 --- a/Assets/Scripts/ServerShared/Behaviors/HeatStorage.cs +++ b/Assets/Scripts/ServerShared/Behaviors/HeatStorage.cs @@ -7,7 +7,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class HeatStorageData : BehaviorData +public class HeatStorageConfig : RuntimeBehaviorConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -21,14 +21,14 @@ public class HeatStorageData : BehaviorData public class HeatStorage : Behavior { - private HeatStorageData _data; + private HeatStorageConfig _data; - public HeatStorage(HeatStorageData data, EquippedItem item) : base(data, item) + public HeatStorage(HeatStorageConfig data, EquippedItem item) : base(data, item) { _data = data; } - public HeatStorage(HeatStorageData data, ConsumableItemEffect item) : base(data, item) + public HeatStorage(HeatStorageConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs index 4f0c5c0d9..a3263f854 100644 --- a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs @@ -5,7 +5,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class InstantWeaponData : WeaponData +public class InstantWeaponConfig : WeaponConfig { [Inspectable, LegacyPayloadKey(17)] public PerformanceStat Count = new PerformanceStat(); @@ -32,7 +32,7 @@ public class InstantWeaponData : WeaponData public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior { - private InstantWeaponData _data; + private InstantWeaponConfig _data; protected int _burstRemaining; private float _burstTimer; @@ -79,13 +79,13 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior OnFire = null; } - public InstantWeapon(InstantWeaponData data, EquippedItem item) : base(data, item) + public InstantWeapon(InstantWeaponConfig data, EquippedItem item) : base(data, item) { _data = data; _ammo = data.MagazineSize; } - public InstantWeapon(InstantWeaponData data, ConsumableItemEffect item) : base(data, item) + public InstantWeapon(InstantWeaponConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; _ammo = data.MagazineSize; diff --git a/Assets/Scripts/ServerShared/Behaviors/ItemUsage.cs b/Assets/Scripts/ServerShared/Behaviors/ItemUsage.cs index 95942d727..7e5fbf604 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ItemUsage.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ItemUsage.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(-5)] -public class ItemUsageData : BehaviorData +public class ItemUsageConfig : RuntimeBehaviorConfig { [LegacyPayloadKey(1)] public Guid Item; @@ -23,14 +23,14 @@ public class ItemUsageData : BehaviorData public class ItemUsage : Behavior { - private ItemUsageData _data; + private ItemUsageConfig _data; - public ItemUsage(ItemUsageData data, EquippedItem item) : base(data, item) + public ItemUsage(ItemUsageConfig data, EquippedItem item) : base(data, item) { _data = data; } - public ItemUsage(ItemUsageData data, ConsumableItemEffect item) : base(data, item) + public ItemUsage(ItemUsageConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Launcher.cs b/Assets/Scripts/ServerShared/Behaviors/Launcher.cs index 6cc8e9246..da16d04af 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Launcher.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Launcher.cs @@ -5,7 +5,7 @@ using Unity.Mathematics; [Inspectable] -public class LauncherData : LockWeaponData +public class LauncherConfig : LockWeaponConfig { [InspectableAnimationCurve, LegacyPayloadKey(26)] public float4[] GuidanceCurve; @@ -32,7 +32,7 @@ public class LauncherData : LockWeaponData } [Inspectable] -public class GuidedWeaponData : InstantWeaponData +public class GuidedWeaponConfig : InstantWeaponConfig { [InspectableAnimationCurve, LegacyPayloadKey(21)] public float4[] GuidanceCurve; diff --git a/Assets/Scripts/ServerShared/Behaviors/LockWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/LockWeapon.cs index 77fa0fdb8..87b0ae253 100644 --- a/Assets/Scripts/ServerShared/Behaviors/LockWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/LockWeapon.cs @@ -5,7 +5,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class LockWeaponData : InstantWeaponData +public class LockWeaponConfig : InstantWeaponConfig { [Inspectable, LegacyPayloadKey(21)] public PerformanceStat LockSpeed = new PerformanceStat(); @@ -34,7 +34,7 @@ public class LockWeaponData : InstantWeaponData public class LockWeapon : InstantWeapon { - private LockWeaponData _data; + private LockWeaponConfig _data; private float _lock; private bool _locking; private Entity _target; @@ -62,11 +62,11 @@ public class LockWeapon : InstantWeapon public Entity LockTarget => _target; - public LockWeapon(LockWeaponData data, EquippedItem item) : base(data, item) + public LockWeapon(LockWeaponConfig data, EquippedItem item) : base(data, item) { _data = data; } - public LockWeapon(LockWeaponData data, ConsumableItemEffect item) : base(data, item) + public LockWeapon(LockWeaponConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/MiningTool.cs b/Assets/Scripts/ServerShared/Behaviors/MiningTool.cs index 43e5ce979..a1213bbd9 100644 --- a/Assets/Scripts/ServerShared/Behaviors/MiningTool.cs +++ b/Assets/Scripts/ServerShared/Behaviors/MiningTool.cs @@ -8,7 +8,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable, Order(10)] -public class MiningToolData : BehaviorData +public class MiningToolConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat DamagePerSecond = new PerformanceStat(); @@ -37,15 +37,15 @@ public class MiningTool : Behavior public Guid AsteroidBelt; public int Asteroid; - private MiningToolData _data; + private MiningToolConfig _data; public float Range { get; private set; } - public MiningTool(MiningToolData data, EquippedItem item) : base(data, item) + public MiningTool(MiningToolConfig data, EquippedItem item) : base(data, item) { _data = data; } - public MiningTool(MiningToolData data, ConsumableItemEffect item) : base(data, item) + public MiningTool(MiningToolConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Radiator.cs b/Assets/Scripts/ServerShared/Behaviors/Radiator.cs index 136bddd84..976bac304 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Radiator.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Radiator.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class RadiatorData : BehaviorData +public class RadiatorConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Emissivity = new PerformanceStat(); @@ -46,13 +46,13 @@ public class Radiator : Behavior, IAlwaysUpdatedBehavior, IInitializableBehavior public float WasteHeat { get; private set; } public float EnergyUsage { get; private set; } - private RadiatorData _data; + private RadiatorConfig _data; - public Radiator(RadiatorData data, EquippedItem item) : base(data, item) + public Radiator(RadiatorConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Radiator(RadiatorData data, ConsumableItemEffect item) : base(data, item) + public Radiator(RadiatorConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Reactor.cs b/Assets/Scripts/ServerShared/Behaviors/Reactor.cs index b2cb8d971..9c498d6aa 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Reactor.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Reactor.cs @@ -10,7 +10,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ReactorData : BehaviorData +public class ReactorConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Charge = new PerformanceStat(); @@ -37,7 +37,7 @@ public class ReactorData : BehaviorData public class Reactor : Behavior, IOrderedBehavior, IDisposable { - private ReactorData _data; + private ReactorConfig _data; public float Draw { get; private set; } @@ -49,12 +49,12 @@ public class Reactor : Behavior, IOrderedBehavior, IDisposable private List _subscriptions = new List(); - public Reactor(ReactorData data, EquippedItem item) : base(data, item) + public Reactor(ReactorConfig data, EquippedItem item) : base(data, item) { _data = data; FindCapacitors(); } - public Reactor(ReactorData data, ConsumableItemEffect item) : base(data, item) + public Reactor(ReactorConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; FindCapacitors(); diff --git a/Assets/Scripts/ServerShared/Behaviors/Reflector.cs b/Assets/Scripts/ServerShared/Behaviors/Reflector.cs index faaf953da..0aa22522b 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Reflector.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Reflector.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ReflectorData : BehaviorData +public class ReflectorConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat CrossSection = new PerformanceStat(); @@ -27,14 +27,14 @@ public class ReflectorData : BehaviorData public class Reflector : Behavior { - private ReflectorData _data; + private ReflectorConfig _data; - public Reflector(ReflectorData data, EquippedItem item) : base(data, item) + public Reflector(ReflectorConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Reflector(ReflectorData data, ConsumableItemEffect item) : base(data, item) + public Reflector(ReflectorConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs b/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs index dbd3e9cb2..114fbb8c5 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ResourceScanner.cs @@ -8,7 +8,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ResourceScannerData : BehaviorData +public class ResourceScannerConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Range = new PerformanceStat(); @@ -34,7 +34,7 @@ public class ResourceScanner : Behavior, IAlwaysUpdatedBehavior { public int Asteroid = -1; - private ResourceScannerData _data; + private ResourceScannerConfig _data; private float _scanTime; private Guid _scanTarget; @@ -56,12 +56,12 @@ public class ResourceScanner : Behavior, IAlwaysUpdatedBehavior } } - public ResourceScanner(ResourceScannerData data, EquippedItem item) : base(data, item) + public ResourceScanner(ResourceScannerConfig data, EquippedItem item) : base(data, item) { _data = data; } - public ResourceScanner(ResourceScannerData data, ConsumableItemEffect item) : base(data, item) + public ResourceScanner(ResourceScannerConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Sensor.cs b/Assets/Scripts/ServerShared/Behaviors/Sensor.cs index 5f4e8fdc8..ae8661a71 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Sensor.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Sensor.cs @@ -8,7 +8,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class SensorData : BehaviorData +public class SensorConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(3)] public PerformanceStat Sensitivity = new PerformanceStat(); @@ -50,7 +50,7 @@ public class SensorData : BehaviorData public class Sensor : Behavior, IEventBehavior { - private SensorData _data; + private SensorConfig _data; private float _pingCooldown; private float _pingLerp; private bool _pinging; @@ -95,12 +95,12 @@ public class Sensor : Behavior, IEventBehavior } } - public Sensor(SensorData data, EquippedItem item) : base(data, item) + public Sensor(SensorConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Sensor(SensorData data, ConsumableItemEffect item) : base(data, item) + public Sensor(SensorConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Shield.cs b/Assets/Scripts/ServerShared/Behaviors/Shield.cs index 59995dc16..2636548e8 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Shield.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Shield.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class ShieldData : BehaviorData +public class ShieldConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Efficiency = new PerformanceStat(); @@ -29,13 +29,13 @@ public class Shield : Behavior, IProgressBehavior public float Efficiency { get; private set; } public float EnergyUsage { get; private set; } - private ShieldData _data; + private ShieldConfig _data; - public Shield(ShieldData data, EquippedItem item) : base(data, item) + public Shield(ShieldConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Shield(ShieldData data, ConsumableItemEffect item) : base(data, item) + public Shield(ShieldConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index 9b0a66a4d..a9fd44fc5 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -7,7 +7,7 @@ using System.Linq; using GameCult.Aetheria.State.Unity; [Inspectable] -public class StatModifierData : BehaviorData +public class StatModifierConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public StatReference Stat = new StatReference(); @@ -18,7 +18,7 @@ public class StatModifierData : BehaviorData [Inspectable, LegacyPayloadKey(3)] public StatModifierType Type; - [InspectableType(typeof(BehaviorData)), LegacyPayloadKey(4)] + [InspectableType(typeof(RuntimeBehaviorConfig)), LegacyPayloadKey(4)] public string RequireBehavior; public override Behavior CreateInstance(EquippedItem item) @@ -35,7 +35,7 @@ public class StatModifierData : BehaviorData [Order(-4)] public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwaysUpdatedBehavior { - private StatModifierData _data; + private StatModifierConfig _data; private PerformanceStat[] _stats; @@ -46,12 +46,12 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa public bool Executed => _executed; public int TargetStatCount => _stats?.Length ?? 0; - public StatModifier(StatModifierData data, EquippedItem item) : base(data, item) + public StatModifier(StatModifierConfig data, EquippedItem item) : base(data, item) { _data = data; } - public StatModifier(StatModifierData data, ConsumableItemEffect item) : base(data, item) + public StatModifier(StatModifierConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } @@ -69,7 +69,7 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa private PerformanceStat FindTargetStat(Behavior behavior) { - var data = behavior.Data; + var data = behavior.Config; var statField = data .GetType() .GetFields() @@ -153,7 +153,7 @@ public enum StatModifierType [Inspectable] public class StatReference { - [InspectableType(typeof(BehaviorData)), LegacyPayloadKey(1)] + [InspectableType(typeof(RuntimeBehaviorConfig)), LegacyPayloadKey(1)] public string Target; [Inspectable, LegacyPayloadKey(2)] diff --git a/Assets/Scripts/ServerShared/Behaviors/Switch.cs b/Assets/Scripts/ServerShared/Behaviors/Switch.cs index b446d7219..078c632b8 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Switch.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Switch.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(-25)] -public class SwitchData : BehaviorData +public class SwitchConfig : RuntimeBehaviorConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -19,15 +19,15 @@ public class SwitchData : BehaviorData public class Switch : Behavior, IActivatedBehavior { - private SwitchData _data; + private SwitchConfig _data; public bool Activated { get; set; } - public Switch(SwitchData data, EquippedItem item) : base(data, item) + public Switch(SwitchConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Switch(SwitchData data, ConsumableItemEffect item) : base(data, item) + public Switch(SwitchConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs b/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs index 0e86436b5..fcde8030c 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(-22)] -public class ThermotoggleData : BehaviorData +public class ThermotoggleConfig : RuntimeBehaviorConfig { [InspectableTemperature, LegacyPayloadKey(1)] public float TargetTemperature; @@ -29,16 +29,16 @@ public class ThermotoggleData : BehaviorData public class Thermotoggle : Behavior { public float TargetTemperature; - private ThermotoggleData _data; + private ThermotoggleConfig _data; - public ThermotoggleData ThermotoggleData => _data; + public ThermotoggleConfig ThermotoggleConfig => _data; - public Thermotoggle(ThermotoggleData data, EquippedItem item) : base(data, item) + public Thermotoggle(ThermotoggleConfig data, EquippedItem item) : base(data, item) { _data = data; TargetTemperature = data.TargetTemperature; } - public Thermotoggle(ThermotoggleData data, ConsumableItemEffect item) : base(data, item) + public Thermotoggle(ThermotoggleConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; TargetTemperature = data.TargetTemperature; diff --git a/Assets/Scripts/ServerShared/Behaviors/Thruster.cs b/Assets/Scripts/ServerShared/Behaviors/Thruster.cs index 06c009b3a..7d7c718aa 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Thruster.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Thruster.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable, EntityTypeRestriction(HullType.Ship)] -public class ThrusterData : BehaviorData +public class ThrusterConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Thrust = new PerformanceStat(); @@ -46,11 +46,11 @@ public class Thruster : Behavior, IAnalogBehavior set => _input = saturate(value); } - private ThrusterData _data; + private ThrusterConfig _data; private float _input; - public Thruster(ThrusterData data, EquippedItem item) : base(data, item) + public Thruster(ThrusterConfig data, EquippedItem item) : base(data, item) { _data = data; ParticlesPrefab = data.ParticlesPrefab; @@ -63,7 +63,7 @@ public class Thruster : Behavior, IAnalogBehavior Thrust = Evaluate(_data.Thrust); } - public Thruster(ThrusterData data, ConsumableItemEffect item) : base(data, item) + public Thruster(ThrusterConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; ParticlesPrefab = data.ParticlesPrefab; diff --git a/Assets/Scripts/ServerShared/Behaviors/Trigger.cs b/Assets/Scripts/ServerShared/Behaviors/Trigger.cs index b31c8a2d1..3c60f133a 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Trigger.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Trigger.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable, Order(-20)] -public class TriggerData : BehaviorData +public class TriggerConfig : RuntimeBehaviorConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -22,8 +22,8 @@ public class Trigger : Behavior, IActivatedBehavior public bool _pulled; public bool Pulled => _pulled; - public Trigger(TriggerData data, EquippedItem item) : base(data, item) { } - public Trigger(TriggerData data, ConsumableItemEffect item) : base(data, item) { } + public Trigger(TriggerConfig data, EquippedItem item) : base(data, item) { } + public Trigger(TriggerConfig data, ConsumableItemEffect item) : base(data, item) { } public override bool Execute(float dt) { diff --git a/Assets/Scripts/ServerShared/Behaviors/TurretController.cs b/Assets/Scripts/ServerShared/Behaviors/TurretController.cs index d83f87709..b374b313a 100644 --- a/Assets/Scripts/ServerShared/Behaviors/TurretController.cs +++ b/Assets/Scripts/ServerShared/Behaviors/TurretController.cs @@ -8,7 +8,7 @@ using UniRx; using Unity.Mathematics; using static Unity.Mathematics.math; using float3 = Unity.Mathematics.float3; -public class TurretControllerData : BehaviorData +public class TurretControllerConfig : RuntimeBehaviorConfig { public override Behavior CreateInstance(EquippedItem item) { @@ -30,11 +30,11 @@ public class TurretController : Behavior, IInitializableBehavior public float ShotSpeed => _shotSpeed; public bool PredictShots => _predictShots; - public TurretController(TurretControllerData data, EquippedItem item) : base(data, item) + public TurretController(TurretControllerConfig data, EquippedItem item) : base(data, item) { } - public TurretController(TurretControllerData data, ConsumableItemEffect item) : base(data, item) + public TurretController(TurretControllerConfig data, ConsumableItemEffect item) : base(data, item) { } diff --git a/Assets/Scripts/ServerShared/Behaviors/VelocityConversion.cs b/Assets/Scripts/ServerShared/Behaviors/VelocityConversion.cs index b40599ff7..2b7d7b077 100644 --- a/Assets/Scripts/ServerShared/Behaviors/VelocityConversion.cs +++ b/Assets/Scripts/ServerShared/Behaviors/VelocityConversion.cs @@ -4,7 +4,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; -public class VelocityConversionData : BehaviorData +public class VelocityConversionConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Lambda = new PerformanceStat(); @@ -21,13 +21,13 @@ public class VelocityConversionData : BehaviorData public class VelocityConversion : Behavior { - private VelocityConversionData _data; + private VelocityConversionConfig _data; - public VelocityConversion(VelocityConversionData data, EquippedItem item) : base(data, item) + public VelocityConversion(VelocityConversionConfig data, EquippedItem item) : base(data, item) { _data = data; } - public VelocityConversion(VelocityConversionData data, ConsumableItemEffect item) : base(data, item) + public VelocityConversion(VelocityConversionConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs b/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs index e709515c8..2b7ba9ee2 100644 --- a/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs +++ b/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs @@ -6,7 +6,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public class VelocityLimitData : BehaviorData +public class VelocityLimitConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat TopSpeed = new PerformanceStat(); @@ -26,15 +26,15 @@ public class VelocityLimit : Behavior { public float Limit { get; private set; } - private VelocityLimitData _data; + private VelocityLimitConfig _data; - public VelocityLimit(VelocityLimitData data, EquippedItem item) : base(data, item) + public VelocityLimit(VelocityLimitConfig data, EquippedItem item) : base(data, item) { _data = data; Limit = Evaluate(_data.TopSpeed); } - public VelocityLimit(VelocityLimitData data, ConsumableItemEffect item) : base(data, item) + public VelocityLimit(VelocityLimitConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; Limit = Evaluate(_data.TopSpeed); diff --git a/Assets/Scripts/ServerShared/Behaviors/Visibility.cs b/Assets/Scripts/ServerShared/Behaviors/Visibility.cs index 694040e81..ba17acf58 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Visibility.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Visibility.cs @@ -5,7 +5,7 @@ using System; using System.Linq; [Inspectable] -public class VisibilityData : BehaviorData +public class VisibilityConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public PerformanceStat Visibility = new PerformanceStat(); @@ -25,13 +25,13 @@ public class VisibilityData : BehaviorData public class Visibility : Behavior { - private VisibilityData _data; + private VisibilityConfig _data; - public Visibility(VisibilityData data, EquippedItem item) : base(data, item) + public Visibility(VisibilityConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Visibility(VisibilityData data, ConsumableItemEffect item) : base(data, item) + public Visibility(VisibilityConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index 0950b7015..a472d64c2 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -9,7 +9,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable] -public abstract class WeaponData : BehaviorData +public abstract class WeaponConfig : RuntimeBehaviorConfig { [Inspectable, LegacyPayloadKey(1)] public DamageType DamageType; @@ -62,7 +62,7 @@ public abstract class WeaponData : BehaviorData public abstract class Weapon : Behavior, IActivatedBehavior { - private WeaponData _data; + private WeaponConfig _data; private PerformanceStat _guidedProjectileThrust; private PerformanceStat _guidedProjectileVelocity; @@ -99,7 +99,7 @@ public abstract class Weapon : Behavior, IActivatedBehavior get => _firing; } - public Weapon(WeaponData data, EquippedItem item) : base(data, item) + public Weapon(WeaponConfig data, EquippedItem item) : base(data, item) { _data = data; DamageType = data.DamageType; @@ -109,7 +109,7 @@ public abstract class Weapon : Behavior, IActivatedBehavior InitializeGuidedProjectileProfile(data); } - public Weapon(WeaponData data, ConsumableItemEffect item) : base(data, item) + public Weapon(WeaponConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; DamageType = data.DamageType; @@ -119,9 +119,9 @@ public abstract class Weapon : Behavior, IActivatedBehavior InitializeGuidedProjectileProfile(data); } - private void InitializeGuidedProjectileProfile(WeaponData data) + private void InitializeGuidedProjectileProfile(WeaponConfig data) { - if (data is LauncherData launcher) + if (data is LauncherConfig launcher) { GuidedProjectileTargeting = GuidedProjectileTargetMode.TargetEntity; GuidedProjectileGuidanceCurve = launcher.GuidanceCurve; @@ -131,7 +131,7 @@ public abstract class Weapon : Behavior, IActivatedBehavior _guidedProjectileThrust = launcher.Thrust; _guidedProjectileVelocity = launcher.MissileVelocity; } - else if (data is GuidedWeaponData guidance) + else if (data is GuidedWeaponConfig guidance) { GuidedProjectileTargeting = GuidedProjectileTargetMode.LookDirection; GuidedProjectileGuidanceCurve = guidance.GuidanceCurve; diff --git a/Assets/Scripts/ServerShared/Behaviors/Wear.cs b/Assets/Scripts/ServerShared/Behaviors/Wear.cs index 57a4dc9e4..877f4d6ac 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Wear.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Wear.cs @@ -7,7 +7,7 @@ using Unity.Mathematics; using static Unity.Mathematics.math; [Inspectable, Order(1000)] -public class WearData : BehaviorData +public class WearConfig : RuntimeBehaviorConfig { [InspectableTemperature, LegacyPayloadKey(1)] public bool PerSecond = true; @@ -24,13 +24,13 @@ public class WearData : BehaviorData public class Wear : Behavior { - private WearData _data; + private WearConfig _data; - public Wear(WearData data, EquippedItem item) : base(data, item) + public Wear(WearConfig data, EquippedItem item) : base(data, item) { _data = data; } - public Wear(WearData data, ConsumableItemEffect item) : base(data, item) + public Wear(WearConfig data, ConsumableItemEffect item) : base(data, item) { _data = data; } diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 5dd2dc4f0..155ab3873 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -19,7 +19,6 @@ using float4 = Unity.Mathematics.float4; public class ItemManager { public Random Random = new Random((uint) (DateTime.Now.Ticks%uint.MaxValue)); - // public SimpleCommodityData[] Resources; // public Dictionary> CorporationControllers = new Dictionary>(); // public Dictionary GalaxyZones; @@ -34,37 +33,37 @@ public class ItemManager private readonly IRuntimeItemCatalogReader _runtimeItems; private static readonly IReadOnlyDictionary BehaviorTypesByKind = new Dictionary(StringComparer.Ordinal) { - { "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) } + { "GuidedWeapon", typeof(GuidedWeaponConfig) }, + { "Launcher", typeof(LauncherConfig) }, + { "Reactor", typeof(ReactorConfig) }, + { "Radiator", typeof(RadiatorConfig) }, + { "StatModifier", typeof(StatModifierConfig) }, + { "Sensor", typeof(SensorConfig) }, + { "Reflector", typeof(ReflectorConfig) }, + { "Shield", typeof(ShieldConfig) }, + { "Thruster", typeof(ThrusterConfig) }, + { "Wear", typeof(WearConfig) }, + { "VelocityConversion", typeof(VelocityConversionConfig) }, + { "VelocityLimit", typeof(VelocityLimitConfig) }, + { "AetherDrive", typeof(AetherDriveConfig) }, + { "Cooldown", typeof(CooldownConfig) }, + { "Heat", typeof(HeatConfig) }, + { "ItemUsage", typeof(ItemUsageConfig) }, + { "Switch", typeof(SwitchConfig) }, + { "Trigger", typeof(TriggerConfig) }, + { "Visibility", typeof(VisibilityConfig) }, + { "Thermotoggle", typeof(ThermotoggleConfig) }, + { "EnergyDraw", typeof(EnergyDrawConfig) }, + { "MiningTool", typeof(MiningToolConfig) }, + { "ResourceScanner", typeof(ResourceScannerConfig) }, + { "Capacitor", typeof(CapacitorConfig) }, + { "Cockpit", typeof(CockpitConfig) }, + { "HeatStorage", typeof(HeatStorageConfig) }, + { "TurretController", typeof(TurretControllerConfig) }, + { "InstantWeapon", typeof(InstantWeaponConfig) }, + { "ConstantWeapon", typeof(ConstantWeaponConfig) }, + { "ChargedWeapon", typeof(ChargedWeaponConfig) }, + { "AutoWeapon", typeof(AutoWeaponConfig) } }; public GameplaySettings GameplaySettings { get; } @@ -80,8 +79,6 @@ public class ItemManager // } // } - // private readonly Dictionary Tier = new Dictionary(); - public ItemManager(IRuntimeItemCatalogReader runtimeItems, GameplaySettings settings, Action logger) { _runtimeItems = runtimeItems; @@ -113,15 +110,15 @@ public class ItemManager .ToArray(); } - private IReadOnlyList CreateRuntimeBehaviorConfigs(ItemInstance item) + private IReadOnlyList CreateRuntimeBehaviorConfigs(ItemInstance item) { var typedItem = GetRuntimeItem(item); return typedItem == null - ? Array.Empty() + ? Array.Empty() : BuildBehaviorConfigs(typedItem); } - private static BehaviorData[] BuildBehaviorConfigs(AetheriaRuntimeCatalogItem item) + private static RuntimeBehaviorConfig[] BuildBehaviorConfigs(AetheriaRuntimeCatalogItem item) { return item.BehaviorPayloads .Select(BuildBehaviorConfig) @@ -129,14 +126,14 @@ public class ItemManager .ToArray(); } - private static BehaviorData BuildBehaviorConfig(AetheriaRuntimeBehaviorPayload payload) + private static RuntimeBehaviorConfig BuildBehaviorConfig(AetheriaRuntimeBehaviorPayload payload) { if (!BehaviorTypesByKind.TryGetValue(payload.Kind, out var behaviorType)) { return null; } - var behavior = Activator.CreateInstance(behaviorType) as BehaviorData; + var behavior = Activator.CreateInstance(behaviorType) as RuntimeBehaviorConfig; if (behavior == null) { return null; diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 5683eb20d..d0eac04f5 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -317,9 +317,9 @@ public class LoadoutGenerator if (hardpoint.Type == nameof(HardpointType.ControlModule)) { var controllerBehaviorKind = entity is Ship - ? nameof(CockpitData) + ? "Cockpit" : entity is OrbitalEntity - ? nameof(TurretControllerData) + ? "TurretController" : null; var controllerRow = RandomCatalogItem(RuntimeItemCandidateKind.Gear, hardpoint, 2, item => HasBehaviorKind(item, controllerBehaviorKind)); if (controllerRow == null) @@ -371,7 +371,7 @@ public class LoadoutGenerator emptyShape = entity.UnoccupiedSpace; var capacitorRow = RandomCatalogItem(RuntimeItemCandidateKind.Gear, 2, - item => item.BehaviorKinds.Contains(nameof(CapacitorData), StringComparer.Ordinal) && + item => item.BehaviorKinds.Contains("Capacitor", StringComparer.Ordinal) && FitsWithin(item, emptyShape)); if (capacitorRow == null) throw new InvalidLoadoutException("No compatible capacitor found for entity!"); diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 770efef58..32c02f5f7 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -631,7 +631,7 @@ public class PropertiesPanel : MonoBehaviour { switch (behavior) { - case Thermotoggle thermotoggle when thermotoggle.ThermotoggleData.Adjustable: + case Thermotoggle thermotoggle when thermotoggle.ThermotoggleConfig.Adjustable: AddField("Target Temperature", () => thermotoggle.TargetTemperature, temp => thermotoggle.TargetTemperature = temp); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 9bab75cfa..fe8c2735e 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -98,13 +98,13 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. custom action-bar icon paths, but the typed field is present and owns that surface when data appears. Player camera articulation grouping now classifies equipped non-launcher weapons through typed behavior kind rows instead of - inspecting runtime `BehaviorData` subclasses. Unity boot reads typed player + inspecting runtime behavior config classes. Unity boot reads typed player settings back through the package-owned CultCache reader before falling back to defaults. - The combat schematic HUD uses typed runtime catalog weapon facets for its static weapon icon strip; missing typed weapon facets no longer fall back to legacy `WeaponItemData`. Schematic weapon-row selection now uses typed - behavior-kind rows instead of inspecting runtime `BehaviorData` subclasses; + behavior-kind rows instead of inspecting runtime behavior config classes; live weapon behavior instances still own ammo, cooldown, and active firing values until those session facts have typed runtime surfaces. Hull and item durability percentages use typed max durability only; incomplete @@ -228,8 +228,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. station bay fit, hull/category, and behavior-kind prefilters run against typed catalog rows. `EquippedItem` and `ConsumableItemEffect` now create behavior instances through `ItemManager.CreateRuntimeBehaviors`; the remaining - `BehaviorData` config list is explicitly temporary and internal to behavior - construction. `StatModifier` requirement and stat-target lookup now inspects + `RuntimeBehaviorConfig` bridge is explicitly temporary and internal to + behavior construction. `StatModifier` requirement and stat-target lookup now inspects the live equipped behavior instances and asks package-owned typed behavior metadata for kind/family matching, not a freshly rebuilt config list or a behavior-local class taxonomy. The unused `TradeMenuDebug` script has been @@ -245,7 +245,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. package-owned typed behavior metadata. The obsolete `RuntimeInspectable` attribute has been deleted from behavior classes and fields. Dynamic behavior columns read typed behavior payload fields by legacy payload key - instead of hydrating `BehaviorData` DTOs. Trade buy decisions for crafted price, + instead of hydrating legacy behavior DTOs. Trade buy decisions for crafted price, ship-hull classification, simple commodity base price, and simple commodity stack size also read typed catalog rows; the existing inventory transfer and ship-construction paths still own the actual runtime mutation. @@ -285,13 +285,13 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. derives from typed hull/item shape rows. `EquippedItem` and `ConsumableItemEffect` behavior construction now read typed behavior payloads through the runtime behavior config bridge before instantiating the - current `BehaviorData`-backed behavior classes. `BehaviorData` remains the - temporary behavior-class config bridge, not the runtime behavior payload - owner; bridge instances carry the typed behavior payload kind so runtime - logic does not have to reselect behavior identity from the old class graph. + current behavior classes. `RuntimeBehaviorConfig` remains the temporary + behavior-class construction bridge, not the runtime behavior payload owner; + bridge instances carry the typed behavior payload kind so runtime logic does + not have to reselect behavior identity from the old class graph. `StatModifier` behavior requirements and behavior-stat targets compare typed behavior kinds on the live equipped behavior instances through - `AetheriaRuntimeBehaviorMetadataCatalog` instead of scanning `BehaviorData` + `AetheriaRuntimeBehaviorMetadataCatalog` instead of scanning config subclasses, rebuilding temporary configs, or hydrating `EquippableItemData.Behaviors`. `ConsumableItemData` and `EquippableItemData` no longer expose legacy `Behaviors` lists at all. The @@ -306,7 +306,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. through package-owned typed behavior display metadata; stat modifier presentation checks the package-owned typed `StatModifier` kind instead of a legacy data class name. Damage-range payload selection is keyed by - package-owned typed weapon behavior metadata; legacy `BehaviorData` ancestry + package-owned typed weapon behavior metadata; legacy behavior config ancestry is no longer a fallback for weapon payload selection. The old explicit `Inspect(ItemData)` DTO inspection overload is deleted; trade row clicks now inspect the typed runtime catalog row directly. Incomplete typed thermal @@ -606,7 +606,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. owns simulation. The runtime no longer has a MessagePack catalog cache or whole-item DTO projection cache. `AetheriaRuntimeItemCatalog` exposes typed item rows only. `ItemManager.CreateRuntimeBehaviors` owns the temporary - projection from typed behavior payloads into `BehaviorData` config objects + projection from typed behavior payloads into `RuntimeBehaviorConfig` objects required by the current behavior constructors. Direct config reads no longer escape `ItemManager`; gameplay stat modifiers target live behavior instances and package-owned @@ -621,7 +621,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. map is keyed by typed behavior payload kind rather than legacy union key. Live `Behavior` instances expose their typed payload kind and group directly, so runtime state projection, stat-modifier matching, and behavior grouping no - longer reach back through `BehaviorData` for behavior identity. + longer reach back through config objects for behavior identity. Runtime item category classification uses package-owned `AetheriaRuntimeItemCategories` tokens; gameplay code should not ask C# legacy DTO class names to classify typed catalog rows. The typed state @@ -973,8 +973,8 @@ First Aetheria surfaces to publish: decide equipped-item temperature footprint geometry. - Done: move `EquippedItem` and `ConsumableItemEffect` behavior construction off `Data.Behaviors` and onto typed runtime behavior payload config - construction; `BehaviorData` remains only the temporary behavior-class - config bridge. + construction; `RuntimeBehaviorConfig` remains only the temporary + behavior-class construction bridge. - Done: route `EquippedItem` and `ConsumableItemEffect` behavior instance creation through `ItemManager.CreateRuntimeBehaviors`; temporary config reads are internal to that construction bridge. @@ -989,20 +989,20 @@ First Aetheria surfaces to publish: live equippable item DTO hierarchy has no active `PerformanceStat` fields. - Done: move `StatModifier` target and requirement lookup onto the live equipped behavior instances. It now modifies the `PerformanceStat` objects - actually held by runtime behavior data instead of rebuilding temporary + actually held by runtime behavior configs instead of rebuilding temporary config DTOs from the catalog. - Done: move `StatModifier` behavior kind/family matching onto `AetheriaRuntimeBehaviorMetadataCatalog`; the behavior only normalizes migrated `*Data` tokens before asking the package-owned metadata owner. - - Done: move live behavior identity reads from the temporary `BehaviorData` - config bridge onto `Behavior.Kind` and `Behavior.Group`, so state + - Done: move live behavior identity reads from the temporary + `RuntimeBehaviorConfig` bridge onto `Behavior.Kind` and `Behavior.Group`, so state snapshots, weapon snapshots, progress rows, stat-modifier matching, and behavior grouping use runtime instance identity. - Done: move TurretController's weapon range/velocity reads off - `WeaponData` casts and onto `Weapon.EvaluateRange`/`EvaluateVelocity`; + weapon config casts and onto `Weapon.EvaluateRange`/`EvaluateVelocity`; weapon config fields remain private inputs to the weapon runtime owner. - Done: move projectile, hitscan, beam, lightning, and mine effect damage - type reads off `WeaponData` and onto `Weapon.DamageType`; effect managers + type reads off weapon configs and onto `Weapon.DamageType`; effect managers consume live weapon metadata instead of config DTO fields. - Done: move weapon effect prefab lookup and constant weapon visual startup off `InstantWeaponData`/`ConstantWeaponData`; `EntityInstance` caches @@ -1308,8 +1308,13 @@ First Aetheria surfaces to publish: old projection vocabulary no longer implies item DTO authority. - Done: delete `IRuntimeItemCatalogReader.GetTemporaryBehaviorConfigs`; the runtime catalog reader now exposes typed item rows only, and the remaining - `BehaviorData` config projection is private `ItemManager` behavior + `RuntimeBehaviorConfig` projection is private `ItemManager` behavior construction machinery. + - Done: rename the temporary behavior construction DTO family from + `BehaviorData`/`*Data` to `RuntimeBehaviorConfig`/`*Config`; live + `Behavior` instances expose `Config`, while typed behavior kind strings + such as `Cockpit`, `TurretController`, and `Capacitor` remain stable + catalog facts rather than class-name-derived selectors. - Done: quarantine the vendored Unity `MessagePack` assembly by disabling asmdef auto-reference; only explicit state-spine assemblies should see it while the Unity CultCache bridge still needs a low-level `.cc` codec.