fix: Drastically simplifies regions (#1400)
### 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" }
```
This commit is contained in:
parent
734d20cbaf
commit
0a9bfb0558
47 changed files with 542 additions and 470 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
|
@ -15,6 +16,7 @@ public class BaseRegion : Region
|
|||
{
|
||||
}
|
||||
|
||||
[JsonConstructor] // Don't include parent, since it is special
|
||||
public BaseRegion(string name, Map map, int priority, params Rectangle3D[] area) : base(name, map, priority, area)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue