Entity Persistence Refactoring

Entities refactored to enable robust persistence
Entities detect stale data references and reload behaviors
This commit is contained in:
hyperion51 2020-05-06 04:56:36 +01:00
commit 6aeb2ae280
29 changed files with 299 additions and 202 deletions

View file

@ -1,13 +1,19 @@
using System;
using System.Collections;
using System.Collections.Generic;
using JsonKnownTypes;
using MessagePack;
using Newtonsoft.Json;
using UnityEngine;
[MessagePackObject,
Union(0, typeof(StationTowing)),
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
public abstract class AgentTask
{
public abstract AgentJob JobType { get; }
public int Priority;
public Guid Zone;
[IgnoreMember] public abstract AgentJob JobType { get; }
[JsonProperty("id"), Key(0)] public int Priority;
[JsonProperty("zone"), Key(1)] public Guid Zone;
}
public enum AgentJob