Demote behavior construction configs
This commit is contained in:
parent
bf03f27709
commit
32187038eb
39 changed files with 209 additions and 206 deletions
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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; } = "";
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<IDisposable> _subscriptions = new List<IDisposable>();
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Guid, List<IController>> CorporationControllers = new Dictionary<Guid, List<IController>>();
|
||||
// public Dictionary<Guid, ZoneDefinition> GalaxyZones;
|
||||
|
||||
|
|
@ -34,37 +33,37 @@ public class ItemManager
|
|||
private readonly IRuntimeItemCatalogReader _runtimeItems;
|
||||
private static readonly IReadOnlyDictionary<string, Type> BehaviorTypesByKind = new Dictionary<string, Type>(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<CraftedItemData, int> Tier = new Dictionary<CraftedItemData, int>();
|
||||
|
||||
public ItemManager(IRuntimeItemCatalogReader runtimeItems, GameplaySettings settings, Action<string> logger)
|
||||
{
|
||||
_runtimeItems = runtimeItems;
|
||||
|
|
@ -113,15 +110,15 @@ public class ItemManager
|
|||
.ToArray();
|
||||
}
|
||||
|
||||
private IReadOnlyList<BehaviorData> CreateRuntimeBehaviorConfigs(ItemInstance item)
|
||||
private IReadOnlyList<RuntimeBehaviorConfig> CreateRuntimeBehaviorConfigs(ItemInstance item)
|
||||
{
|
||||
var typedItem = GetRuntimeItem(item);
|
||||
return typedItem == null
|
||||
? Array.Empty<BehaviorData>()
|
||||
? Array.Empty<RuntimeBehaviorConfig>()
|
||||
: 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;
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue