### Summary
- [X] Gets rid of the Dtos
- [X] Simplifies the json serializer registration
- [X] Adds a custom `RegionByName` JsonConverter that can look up other regions that have already been registered.
### BREAKING CHANGE
1. **Child regions must appear after their parents in the JSON file**
2. In the regions json file, _"Parent"_ can no longer be just a string. It must be an object that includes the map.
- ```json
"Parent": { "Name": "Britain", "Map": "Felucca" }
```
28 lines
976 B
C#
28 lines
976 B
C#
using System;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Server.Regions;
|
|
|
|
public class TokunoDocksRegion : NoHousingGuardedRegion
|
|
{
|
|
[JsonConstructor] // Don't include parent, since it is special
|
|
public TokunoDocksRegion(string name, Map map, int priority, params Rectangle3D[] area) : base(name, map, priority, area)
|
|
{
|
|
}
|
|
|
|
public TokunoDocksRegion(string name, Map map, int priority, params Rectangle2D[] area) : base(name, map, priority, area)
|
|
{
|
|
}
|
|
|
|
public TokunoDocksRegion(string name, Map map, Region parent, params Rectangle3D[] area) : base(name, map, parent, area)
|
|
{
|
|
}
|
|
|
|
public TokunoDocksRegion(string name, Map map, Region parent, int priority, params Rectangle3D[] area) : base(name, map, parent, priority, area)
|
|
{
|
|
}
|
|
|
|
public TokunoDocksRegion(string name, Map map, Region parent, int priority, Type guardType, params Rectangle3D[] area) : base(name, map, parent, priority, guardType, area)
|
|
{
|
|
}
|
|
}
|