ModernUO/Projects/UOContent/Engines/Bulk Orders/Books/BOBLargeSubEntry.cs
Kamron Batman e0225c6e59
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`.
2023-10-01 17:38:52 -07:00

35 lines
751 B
C#

using System;
using ModernUO.Serialization;
namespace Server.Engines.BulkOrders;
[SerializationGenerator(0)]
public partial class BOBLargeSubEntry
{
[SerializableField(0, setter: "private")]
private Type _itemType;
[EncodedInt]
[SerializableField(1, setter: "private")]
private int _amountCur;
[EncodedInt]
[SerializableField(2, setter: "private")]
private int _number;
[EncodedInt]
[SerializableField(3, setter: "private")]
private int _graphic;
public BOBLargeSubEntry()
{
}
public BOBLargeSubEntry(LargeBulkEntry lbe)
{
_itemType = lbe.Details.Type;
_amountCur = lbe.Amount;
_number = lbe.Details.Number;
_graphic = lbe.Details.Graphic;
}
}