fix: Adds generic entity persistence support and BOBEntry as entities (#1527)

### Summary
Adds a generic entity persistence. This can be used to create new entity types that have a `Serial`.

Here is an example:

```cs
public class BOBEntries : GenericEntitySerialization<IBOBEntry>
{
    public static void Configure()
    {
        Configure("BOBEntries");
    }
}
```

The annotation tells the system what folder to serialize the entries to. The class/interface (`IBOBEntry`) is the root type that implements `ISerializable`.
This commit is contained in:
Kamron Batman 2023-10-01 17:38:52 -07:00 committed by GitHub
parent 666b83a3dd
commit e0225c6e59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 666 additions and 311 deletions

View file

@ -24,8 +24,6 @@ public interface ISerializable
// Should be serialized/deserialized with the index so it can be referenced by IGenericReader
DateTime Created { get; set; }
// Should be serialized/deserialized with the index so it can be referenced by IGenericReader
DateTime LastSerialized { get; protected internal set; }
long SavePosition { get; protected internal set; }
BufferWriter SaveBuffer { get; protected internal set; }
@ -61,7 +59,6 @@ public interface ISerializable
return;
}
LastSerialized = Core.Now;
SaveBuffer.Seek(0, SeekOrigin.Begin);
Serialize(SaveBuffer);