ModernUO/Projects/UOContent/Engines/Bulk Orders/Books/BOBEntries.cs
Kamron Batman f2de2fbb77
fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528)
### Summary
- [X] Fixed a bug where entity persistence was serialized out of order, causing world corruption.
- [X] Fixed LastSerialized not being utilized properly and dangling references still becoming an issue.
- [X] Added a new `GenericEntityPersistence<T>` type to encapsulate `ISerializable` serialization.
- [X] Removing the custom logic and moved Items, Mobiles, Guilds, and Accounts  to GenericEntityPersistence.
- [X] Changed serialization to use the singleton pattern to reduce calling methods from stored variables.
2023-10-01 22:10:47 -07:00

21 lines
595 B
C#

namespace Server.Engines.BulkOrders;
public class BOBEntries : GenericEntityPersistence<IBOBEntry>
{
private static BOBEntries _bobEntriesPersistence;
public static void Configure()
{
_bobEntriesPersistence = new BOBEntries();
}
public BOBEntries() : base("BOBEntries", 3, 0x1, 0x7FFFFFFF)
{
}
public static Serial NewBOBEntry => _bobEntriesPersistence.NewEntity;
public static void Add(IBOBEntry entity) => _bobEntriesPersistence.AddEntity(entity);
public static void Remove(IBOBEntry entity) => _bobEntriesPersistence.AddEntity(entity);
}