Entity Persistence Refactoring
Entities refactored to enable robust persistence Entities detect stale data references and reload behaviors
This commit is contained in:
parent
87acc75b96
commit
6aeb2ae280
29 changed files with 299 additions and 202 deletions
|
|
@ -4,7 +4,7 @@ using Unity.Mathematics;
|
|||
using static Unity.Mathematics.math;
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class TurningData : IBehaviorData
|
||||
public class TurningData : BehaviorData
|
||||
{
|
||||
[InspectableField, JsonProperty("torque"), Key(0)]
|
||||
public PerformanceStat Torque = new PerformanceStat();
|
||||
|
|
@ -15,7 +15,7 @@ public class TurningData : IBehaviorData
|
|||
[InspectableField, JsonProperty("heat"), Key(2)]
|
||||
public PerformanceStat Heat = new PerformanceStat();
|
||||
|
||||
public IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
||||
public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
|
||||
{
|
||||
return new Turning(context, this, entity, item);
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ public class Turning : IAnalogBehavior
|
|||
public Gear Item { get; }
|
||||
public GameContext Context { get; }
|
||||
|
||||
public IBehaviorData Data => _data;
|
||||
public BehaviorData Data => _data;
|
||||
|
||||
private TurningData _data;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue