ModernUO/Projects/UOContent/Regions/JsonDtos/TownRegionJsonDto.cs
Kamron Batman 1f778cfacf
fix: Fixes regions having the wrong type (#1260)
## Possible Breaking Change
* Reverted regions.json back to RunUO until newer regions are implemented and proper expansion checks are added.

### Other Changes
- [X] Adds `Region.IsPartOf<T1, T2>()` to check for multiple types.
- [X] Fixes regions.json being wrong
- [X] Adds lots of missing regions. **They are not implemented properly yet**
- [X] Adds regions.xml -> regions.json (check ModernUO Discord)
- [X] Adds expansion specific regions.
2022-11-21 16:47:40 -08:00

26 lines
595 B
C#

namespace Server.Regions;
public class TownRegionJsonDto<TRegion> : BaseRegionJsonDto<TRegion> where TRegion : TownRegion
{
public Point3D Entrance { get; set; }
public override void FromRegion(Region region)
{
base.FromRegion(region);
if (region is TownRegion townRegion)
{
Entrance = townRegion.Entrance;
}
}
protected override void HydrateRegion(Region region)
{
base.HydrateRegion(region);
if (region is TownRegion townRegion)
{
townRegion.Entrance = Entrance;
}
}
}