Updates Data to JSON (#159)
This commit is contained in:
parent
d2f7e08de4
commit
1246a135f7
61 changed files with 18005 additions and 9152 deletions
|
|
@ -1,391 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Geometry.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[Parsable]
|
||||
public struct Point2D : IPoint2D, IComparable<Point2D>, IEquatable<object>, IEquatable<Point2D>
|
||||
{
|
||||
internal int m_X;
|
||||
internal int m_Y;
|
||||
|
||||
public static readonly Point2D Zero = new Point2D(0, 0);
|
||||
|
||||
public Point2D(int x, int y)
|
||||
{
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
}
|
||||
|
||||
public Point2D(IPoint2D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_X;
|
||||
set => m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Y;
|
||||
set => m_Y = value;
|
||||
}
|
||||
|
||||
public override string ToString() => $"({m_X}, {m_Y})";
|
||||
|
||||
public static Point2D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param1 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
var param2 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
return new Point2D(Convert.ToInt32(param1), Convert.ToInt32(param2));
|
||||
}
|
||||
|
||||
public int CompareTo(Point2D other)
|
||||
{
|
||||
var v = m_X.CompareTo(other.m_X);
|
||||
|
||||
if (v == 0)
|
||||
v = m_Y.CompareTo(other.m_Y);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
public override bool Equals(object o) => o is IPoint2D p && m_X == p.X && m_Y == p.Y;
|
||||
|
||||
public bool Equals(Point2D p) => m_X == p.X && m_Y == p.Y;
|
||||
|
||||
public override int GetHashCode() => m_X ^ m_Y;
|
||||
|
||||
public static bool operator ==(Point2D l, Point2D r) => l.m_X == r.m_X && l.m_Y == r.m_Y;
|
||||
|
||||
public static bool operator !=(Point2D l, Point2D r) => l.m_X != r.m_X || l.m_Y != r.m_Y;
|
||||
|
||||
public static bool operator ==(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y;
|
||||
|
||||
public static bool operator !=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y);
|
||||
|
||||
public static bool operator >(Point2D l, Point2D r) => l.m_X > r.m_X && l.m_Y > r.m_Y;
|
||||
|
||||
public static bool operator >(Point2D l, Point3D r) => l.m_X > r.m_X && l.m_Y > r.m_Y;
|
||||
|
||||
public static bool operator >(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X > r.X && l.m_Y > r.Y;
|
||||
|
||||
public static bool operator <(Point2D l, Point2D r) => l.m_X < r.m_X && l.m_Y < r.m_Y;
|
||||
|
||||
public static bool operator <(Point2D l, Point3D r) => l.m_X < r.m_X && l.m_Y < r.m_Y;
|
||||
|
||||
public static bool operator <(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X < r.X && l.m_Y < r.Y;
|
||||
|
||||
public static bool operator >=(Point2D l, Point2D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y;
|
||||
|
||||
public static bool operator >=(Point2D l, Point3D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y;
|
||||
|
||||
public static bool operator >=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X >= r.X && l.m_Y >= r.Y;
|
||||
|
||||
public static bool operator <=(Point2D l, Point2D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y;
|
||||
|
||||
public static bool operator <=(Point2D l, Point3D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y;
|
||||
|
||||
public static bool operator <=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X <= r.X && l.m_Y <= r.Y;
|
||||
}
|
||||
|
||||
[Parsable]
|
||||
public struct Point3D : IPoint3D, IComparable<Point3D>, IEquatable<object>, IEquatable<Point3D>
|
||||
{
|
||||
internal int m_X;
|
||||
internal int m_Y;
|
||||
internal int m_Z;
|
||||
|
||||
public static readonly Point3D Zero = new Point3D(0, 0, 0);
|
||||
|
||||
public Point3D(int x, int y, int z)
|
||||
{
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
m_Z = z;
|
||||
}
|
||||
|
||||
public Point3D(IPoint3D p)
|
||||
: this(p.X, p.Y, p.Z)
|
||||
{
|
||||
}
|
||||
|
||||
public Point3D(IPoint2D p, int z)
|
||||
: this(p.X, p.Y, z)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_X;
|
||||
set => m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Y;
|
||||
set => m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Z
|
||||
{
|
||||
get => m_Z;
|
||||
set => m_Z = value;
|
||||
}
|
||||
|
||||
public override string ToString() => $"({m_X}, {m_Y}, {m_Z})";
|
||||
|
||||
public override bool Equals(object o) => o is IPoint3D p && m_X == p.X && m_Y == p.Y && m_Z == p.Z;
|
||||
|
||||
public bool Equals(Point3D p) => m_X == p.X && m_Y == p.Y && m_Z == p.Z;
|
||||
|
||||
public override int GetHashCode() => m_X ^ m_Y ^ m_Z;
|
||||
|
||||
public static Point3D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param1 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param2 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
var param3 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
return new Point3D(Convert.ToInt32(param1), Convert.ToInt32(param2), Convert.ToInt32(param3));
|
||||
}
|
||||
|
||||
public static bool operator ==(Point3D l, Point3D r) => l.m_X == r.m_X && l.m_Y == r.m_Y && l.m_Z == r.m_Z;
|
||||
|
||||
public static bool operator !=(Point3D l, Point3D r) => l.m_X != r.m_X || l.m_Y != r.m_Y || l.m_Z != r.m_Z;
|
||||
|
||||
public static bool operator ==(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y && l.m_Z == r.Z;
|
||||
|
||||
public static bool operator !=(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y || l.m_Z != r.Z);
|
||||
|
||||
public int CompareTo(Point3D other)
|
||||
{
|
||||
var v = m_X.CompareTo(other.m_X);
|
||||
|
||||
if (v == 0)
|
||||
{
|
||||
v = m_Y.CompareTo(other.m_Y);
|
||||
|
||||
if (v == 0)
|
||||
v = m_Z.CompareTo(other.m_Z);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
[NoSort]
|
||||
[Parsable]
|
||||
[PropertyObject]
|
||||
public struct Rectangle2D
|
||||
{
|
||||
private Point2D m_Start;
|
||||
private Point2D m_End;
|
||||
|
||||
public Rectangle2D(IPoint2D start, IPoint2D end)
|
||||
{
|
||||
m_Start = new Point2D(start);
|
||||
m_End = new Point2D(end);
|
||||
}
|
||||
|
||||
public Rectangle2D(int x, int y, int width, int height)
|
||||
{
|
||||
m_Start = new Point2D(x, y);
|
||||
m_End = new Point2D(x + width, y + height);
|
||||
}
|
||||
|
||||
public void Set(int x, int y, int width, int height)
|
||||
{
|
||||
m_Start = new Point2D(x, y);
|
||||
m_End = new Point2D(x + width, y + height);
|
||||
}
|
||||
|
||||
public static Rectangle2D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param1 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param2 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
var param3 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
var param4 = value.Substring(start + 1, end - (start + 1)).Trim();
|
||||
|
||||
return new Rectangle2D(Convert.ToInt32(param1), Convert.ToInt32(param2), Convert.ToInt32(param3),
|
||||
Convert.ToInt32(param4));
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point2D Start
|
||||
{
|
||||
get => m_Start;
|
||||
set => m_Start = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point2D End
|
||||
{
|
||||
get => m_End;
|
||||
set => m_End = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_Start.m_X;
|
||||
set => m_Start.m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Start.m_Y;
|
||||
set => m_Start.m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Width
|
||||
{
|
||||
get => m_End.m_X - m_Start.m_X;
|
||||
set => m_End.m_X = m_Start.m_X + value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Height
|
||||
{
|
||||
get => m_End.m_Y - m_Start.m_Y;
|
||||
set => m_End.m_Y = m_Start.m_Y + value;
|
||||
}
|
||||
|
||||
public void MakeHold(Rectangle2D r)
|
||||
{
|
||||
if (r.m_Start.m_X < m_Start.m_X)
|
||||
m_Start.m_X = r.m_Start.m_X;
|
||||
|
||||
if (r.m_Start.m_Y < m_Start.m_Y)
|
||||
m_Start.m_Y = r.m_Start.m_Y;
|
||||
|
||||
if (r.m_End.m_X > m_End.m_X)
|
||||
m_End.m_X = r.m_End.m_X;
|
||||
|
||||
if (r.m_End.m_Y > m_End.m_Y)
|
||||
m_End.m_Y = r.m_End.m_Y;
|
||||
}
|
||||
|
||||
public bool Contains(Point3D p) =>
|
||||
m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y;
|
||||
|
||||
public bool Contains(Point2D p) =>
|
||||
m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y;
|
||||
|
||||
public bool Contains(IPoint2D p) => m_Start <= p && m_End > p;
|
||||
|
||||
public override string ToString() => $"({X}, {Y})+({Width}, {Height})";
|
||||
}
|
||||
|
||||
[NoSort]
|
||||
[PropertyObject]
|
||||
public struct Rectangle3D
|
||||
{
|
||||
public Rectangle3D(Point3D start, Point3D end)
|
||||
{
|
||||
Start = start;
|
||||
End = end;
|
||||
}
|
||||
|
||||
public Rectangle3D(int x, int y, int z, int width, int height, int depth)
|
||||
{
|
||||
Start = new Point3D(x, y, z);
|
||||
End = new Point3D(x + width, y + height, z + depth);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D Start { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D End { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Width => End.X - Start.X;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Height => End.Y - Start.Y;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Depth => End.Z - Start.Z;
|
||||
|
||||
public bool Contains(Point3D p) =>
|
||||
p.m_X >= Start.m_X
|
||||
&& p.m_X < End.m_X
|
||||
&& p.m_Y >= Start.m_Y
|
||||
&& p.m_Y < End.m_Y
|
||||
&& p.m_Z >= Start.m_Z
|
||||
&& p.m_Z < End.m_Z;
|
||||
|
||||
public bool Contains(IPoint3D p) =>
|
||||
p.X >= Start.m_X
|
||||
&& p.X < End.m_X
|
||||
&& p.Y >= Start.m_Y
|
||||
&& p.Y < End.m_Y
|
||||
&& p.Z >= Start.m_Z
|
||||
&& p.Z < End.m_Z;
|
||||
}
|
||||
}
|
||||
122
Projects/Server/Geometry/Point2D.cs
Normal file
122
Projects/Server/Geometry/Point2D.cs
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: Point2D.cs - Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[Parsable]
|
||||
public struct Point2D :
|
||||
IPoint2D, IComparable<Point2D>, IComparable<IPoint2D>, IEquatable<object>, IEquatable<Point2D>, IEquatable<IPoint2D>
|
||||
{
|
||||
internal int m_X;
|
||||
internal int m_Y;
|
||||
|
||||
public static readonly Point2D Zero = new Point2D(0, 0);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_X;
|
||||
set => m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Y;
|
||||
set => m_Y = value;
|
||||
}
|
||||
|
||||
public Point2D(int x, int y)
|
||||
{
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
}
|
||||
|
||||
public Point2D(IPoint2D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString() => $"({m_X}, {m_Y})";
|
||||
|
||||
public static Point2D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int x);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int y);
|
||||
|
||||
return new Point2D(x, y);
|
||||
}
|
||||
|
||||
public bool Equals(Point2D other) => m_X == other.m_X && m_Y == other.m_Y;
|
||||
|
||||
public bool Equals(IPoint2D other) =>
|
||||
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y;
|
||||
|
||||
public override bool Equals(object obj) => obj is Point2D other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(m_X, m_Y);
|
||||
|
||||
public static bool operator ==(Point2D l, Point2D r) => l.m_X == r.m_X && l.m_Y == r.m_Y;
|
||||
|
||||
public static bool operator !=(Point2D l, Point2D r) => l.m_X != r.m_X || l.m_Y != r.m_Y;
|
||||
|
||||
public static bool operator ==(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y;
|
||||
|
||||
public static bool operator !=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y);
|
||||
|
||||
public static bool operator >(Point2D l, Point2D r) => l.m_X > r.m_X && l.m_Y > r.m_Y;
|
||||
|
||||
public static bool operator >(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X > r.X && l.m_Y > r.Y;
|
||||
|
||||
public static bool operator <(Point2D l, Point2D r) => l.m_X < r.m_X && l.m_Y < r.m_Y;
|
||||
|
||||
public static bool operator <(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X < r.X && l.m_Y < r.Y;
|
||||
|
||||
public static bool operator >=(Point2D l, Point2D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y;
|
||||
|
||||
public static bool operator >=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X >= r.X && l.m_Y >= r.Y;
|
||||
|
||||
public static bool operator <=(Point2D l, Point2D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y;
|
||||
|
||||
public static bool operator <=(Point2D l, IPoint2D r) => !ReferenceEquals(r, null) && l.m_X <= r.X && l.m_Y <= r.Y;
|
||||
|
||||
public int CompareTo(Point2D other)
|
||||
{
|
||||
var xComparison = m_X.CompareTo(other.m_X);
|
||||
if (xComparison != 0) return xComparison;
|
||||
return m_Y.CompareTo(other.m_Y);
|
||||
}
|
||||
|
||||
public int CompareTo(IPoint2D other)
|
||||
{
|
||||
var xComparison = m_X.CompareTo(other.X);
|
||||
if (xComparison != 0) return xComparison;
|
||||
return m_Y.CompareTo(other.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
150
Projects/Server/Geometry/Point3D.cs
Normal file
150
Projects/Server/Geometry/Point3D.cs
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: Point3D.cs - Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[Parsable]
|
||||
public struct Point3D :
|
||||
IPoint3D, IComparable<Point3D>, IComparable<IPoint3D>, IEquatable<object>, IEquatable<Point3D>, IEquatable<IPoint3D>
|
||||
{
|
||||
internal int m_X;
|
||||
internal int m_Y;
|
||||
internal int m_Z;
|
||||
|
||||
public static readonly Point3D Zero = new Point3D(0, 0, 0);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_X;
|
||||
set => m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Y;
|
||||
set => m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Z
|
||||
{
|
||||
get => m_Z;
|
||||
set => m_Z = value;
|
||||
}
|
||||
|
||||
public Point3D(IPoint3D p) : this(p.X, p.Y, p.Z)
|
||||
{
|
||||
}
|
||||
|
||||
public Point3D(IPoint2D p, int z) : this(p.X, p.Y, z)
|
||||
{
|
||||
}
|
||||
|
||||
public Point3D(int x, int y, int z)
|
||||
{
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
m_Z = z;
|
||||
}
|
||||
|
||||
public override string ToString() => $"({m_X}, {m_Y}, {m_Z})";
|
||||
|
||||
public bool Equals(Point3D other) => m_X == other.m_X && m_Y == other.m_Y && m_Z == other.m_Z;
|
||||
|
||||
public bool Equals(IPoint3D other) =>
|
||||
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y && m_Z == other.Z;
|
||||
|
||||
public override bool Equals(object obj) => obj is Point3D other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(m_X, m_Y, m_Z);
|
||||
|
||||
public static Point3D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int x);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int y);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int z);
|
||||
|
||||
return new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
public static bool operator ==(Point3D l, Point3D r) => l.m_X == r.m_X && l.m_Y == r.m_Y && l.m_Z == r.m_Z;
|
||||
|
||||
public static bool operator ==(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X == r.X && l.m_Y == r.Y && l.m_Z == r.Z;
|
||||
|
||||
public static bool operator !=(Point3D l, Point3D r) => l.m_X != r.m_X || l.m_Y != r.m_Y || l.m_Z != r.m_Z;
|
||||
|
||||
public static bool operator !=(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && (l.m_X != r.X || l.m_Y != r.Y || l.m_Z != r.Z);
|
||||
|
||||
public static bool operator >(Point3D l, Point3D r) => l.m_X > r.m_X && l.m_Y > r.m_Y && l.m_Z > r.m_Z;
|
||||
|
||||
public static bool operator >(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X > r.X && l.m_Y > r.Y && l.m_Z > r.Z;
|
||||
|
||||
public static bool operator <(Point3D l, Point3D r) => l.m_X < r.m_X && l.m_Y < r.m_Y && l.m_Z > r.m_Z;
|
||||
|
||||
public static bool operator <(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X < r.X && l.m_Y < r.Y && l.m_Z > r.Z;
|
||||
|
||||
public static bool operator >=(Point3D l, Point3D r) => l.m_X >= r.m_X && l.m_Y >= r.m_Y && l.m_Z > r.m_Z;
|
||||
|
||||
public static bool operator >=(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X >= r.X && l.m_Y >= r.Y && l.m_Z > r.Z;
|
||||
|
||||
public static bool operator <=(Point3D l, Point3D r) => l.m_X <= r.m_X && l.m_Y <= r.m_Y && l.m_Z > r.m_Z;
|
||||
|
||||
public static bool operator <=(Point3D l, IPoint3D r) =>
|
||||
!ReferenceEquals(r, null) && l.m_X <= r.X && l.m_Y <= r.Y && l.m_Z > r.Z;
|
||||
|
||||
public int CompareTo(Point3D other)
|
||||
{
|
||||
var xComparison = m_X.CompareTo(other.m_X);
|
||||
if (xComparison != 0) return xComparison;
|
||||
var yComparison = m_Y.CompareTo(other.m_Y);
|
||||
if (yComparison != 0) return yComparison;
|
||||
return m_Z.CompareTo(other.m_Z);
|
||||
}
|
||||
|
||||
public int CompareTo(IPoint3D other)
|
||||
{
|
||||
var xComparison = m_X.CompareTo(other.X);
|
||||
if (xComparison != 0) return xComparison;
|
||||
var yComparison = m_Y.CompareTo(other.Y);
|
||||
if (yComparison != 0) return yComparison;
|
||||
return m_Z.CompareTo(other.Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
141
Projects/Server/Geometry/Rectangle2D.cs
Normal file
141
Projects/Server/Geometry/Rectangle2D.cs
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: Rectangle2D.cs - Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[NoSort]
|
||||
[Parsable]
|
||||
[PropertyObject]
|
||||
public struct Rectangle2D
|
||||
{
|
||||
private Point2D m_Start;
|
||||
private Point2D m_End;
|
||||
|
||||
public Rectangle2D(IPoint2D start, IPoint2D end)
|
||||
{
|
||||
m_Start = new Point2D(start);
|
||||
m_End = new Point2D(end);
|
||||
}
|
||||
|
||||
public Rectangle2D(int x, int y, int width, int height)
|
||||
{
|
||||
m_Start = new Point2D(x, y);
|
||||
m_End = new Point2D(x + width, y + height);
|
||||
}
|
||||
|
||||
public void Set(int x, int y, int width, int height)
|
||||
{
|
||||
m_Start = new Point2D(x, y);
|
||||
m_End = new Point2D(x + width, y + height);
|
||||
}
|
||||
|
||||
public static Rectangle2D Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int x);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int y);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int w);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int h);
|
||||
|
||||
return new Rectangle2D(x, y, w, h);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point2D Start
|
||||
{
|
||||
get => m_Start;
|
||||
set => m_Start = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point2D End
|
||||
{
|
||||
get => m_End;
|
||||
set => m_End = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_Start.m_X;
|
||||
set => m_Start.m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Start.m_Y;
|
||||
set => m_Start.m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Width
|
||||
{
|
||||
get => m_End.m_X - m_Start.m_X;
|
||||
set => m_End.m_X = m_Start.m_X + value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Height
|
||||
{
|
||||
get => m_End.m_Y - m_Start.m_Y;
|
||||
set => m_End.m_Y = m_Start.m_Y + value;
|
||||
}
|
||||
|
||||
public void MakeHold(Rectangle2D r)
|
||||
{
|
||||
if (r.m_Start.m_X < m_Start.m_X)
|
||||
m_Start.m_X = r.m_Start.m_X;
|
||||
|
||||
if (r.m_Start.m_Y < m_Start.m_Y)
|
||||
m_Start.m_Y = r.m_Start.m_Y;
|
||||
|
||||
if (r.m_End.m_X > m_End.m_X)
|
||||
m_End.m_X = r.m_End.m_X;
|
||||
|
||||
if (r.m_End.m_Y > m_End.m_Y)
|
||||
m_End.m_Y = r.m_End.m_Y;
|
||||
}
|
||||
|
||||
public bool Contains(Point3D p) =>
|
||||
m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y;
|
||||
|
||||
public bool Contains(Point2D p) =>
|
||||
m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y;
|
||||
|
||||
public bool Contains(IPoint2D p) => m_Start <= p && m_End > p;
|
||||
|
||||
public override string ToString() => $"({X}, {Y})+({Width}, {Height})";
|
||||
}
|
||||
}
|
||||
123
Projects/Server/Geometry/Rectangle3D.cs
Normal file
123
Projects/Server/Geometry/Rectangle3D.cs
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: Rectangle3D.cs - Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[NoSort]
|
||||
[PropertyObject]
|
||||
public struct Rectangle3D
|
||||
{
|
||||
private Point3D m_Start;
|
||||
private Point3D m_End;
|
||||
|
||||
public Rectangle3D(Point3D start, Point3D end)
|
||||
{
|
||||
m_Start = start;
|
||||
m_End = end;
|
||||
}
|
||||
|
||||
public Rectangle3D(int x, int y, int z, int width, int height, int depth)
|
||||
{
|
||||
m_Start = new Point3D(x, y, z);
|
||||
m_End = new Point3D(x + width, y + height, z + depth);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D Start
|
||||
{
|
||||
get => m_Start;
|
||||
set => m_Start = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D End
|
||||
{
|
||||
get => m_End;
|
||||
set => m_End = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_Start.m_X;
|
||||
set => m_Start.m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Start.m_Y;
|
||||
set => m_Start.m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Z
|
||||
{
|
||||
get => m_Start.m_Z;
|
||||
set => m_Start.m_Z = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Width => m_End.X - m_Start.X;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Height => m_End.Y - m_Start.Y;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Depth => m_End.Z - m_Start.Z;
|
||||
|
||||
public void MakeHold(Rectangle3D r)
|
||||
{
|
||||
if (r.m_Start.m_X < m_Start.m_X)
|
||||
m_Start.m_X = r.m_Start.m_X;
|
||||
|
||||
if (r.m_Start.m_Y < m_Start.m_Y)
|
||||
m_Start.m_Y = r.m_Start.m_Y;
|
||||
|
||||
if (r.m_Start.m_Z < m_Start.m_Z)
|
||||
m_Start.m_Z = r.m_Start.m_Z;
|
||||
|
||||
if (r.m_End.m_X > m_End.m_X)
|
||||
m_End.m_X = r.m_End.m_X;
|
||||
|
||||
if (r.m_End.m_Y > m_End.m_Y)
|
||||
m_End.m_Y = r.m_End.m_Y;
|
||||
|
||||
if (r.m_End.m_Z < m_End.m_Z)
|
||||
m_End.m_Z = r.m_End.m_Z;
|
||||
}
|
||||
|
||||
public bool Contains(Point3D p) =>
|
||||
p.m_X >= m_Start.m_X
|
||||
&& p.m_X < m_End.m_X
|
||||
&& p.m_Y >= m_Start.m_Y
|
||||
&& p.m_Y < m_End.m_Y
|
||||
&& p.m_Z >= m_Start.m_Z
|
||||
&& p.m_Z < m_End.m_Z;
|
||||
|
||||
public bool Contains(IPoint3D p) =>
|
||||
p.X >= m_Start.m_X
|
||||
&& p.X < m_End.m_X
|
||||
&& p.Y >= m_Start.m_Y
|
||||
&& p.Y < m_End.m_Y
|
||||
&& p.Z >= m_Start.m_Z
|
||||
&& p.Z < m_End.m_Z;
|
||||
}
|
||||
}
|
||||
173
Projects/Server/Geometry/WorldLocation.cs
Normal file
173
Projects/Server/Geometry/WorldLocation.cs
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: WorldLocation.cs - Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
[Parsable]
|
||||
public struct WorldLocation : IPoint3D, IComparable<WorldLocation>, IEquatable<object>, IEquatable<WorldLocation>, IEquatable<IEntity>
|
||||
{
|
||||
internal Point3D m_Loc;
|
||||
internal Map m_Map;
|
||||
|
||||
public static readonly WorldLocation Zero = new WorldLocation(0, 0, 0, Map.Internal);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D Location
|
||||
{
|
||||
get => m_Loc;
|
||||
set => m_Loc = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
{
|
||||
get => m_Loc.m_X;
|
||||
set => m_Loc.m_X = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Y
|
||||
{
|
||||
get => m_Loc.m_Y;
|
||||
set => m_Loc.m_Y = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int Z
|
||||
{
|
||||
get => m_Loc.m_Z;
|
||||
set => m_Loc.m_Z = value;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Map Map
|
||||
{
|
||||
get => m_Map;
|
||||
set => m_Map = value;
|
||||
}
|
||||
|
||||
public WorldLocation(IEntity e) : this(e.Location.X, e.Location.Y, e.Location.Z, e.Map)
|
||||
{
|
||||
}
|
||||
|
||||
public WorldLocation(IPoint2D p, Map map) : this(p.X, p.Y, 0, map)
|
||||
{
|
||||
}
|
||||
|
||||
public WorldLocation(int x, int y, Map map) : this(x, y, 0, map)
|
||||
{
|
||||
}
|
||||
|
||||
public WorldLocation(IPoint3D p, Map map) : this(p.X, p.Y, p.Z, map)
|
||||
{
|
||||
}
|
||||
|
||||
public WorldLocation(int x, int y, int z, Map map)
|
||||
{
|
||||
m_Loc.m_X = x;
|
||||
m_Loc.m_Y = y;
|
||||
m_Loc.m_Z = z;
|
||||
m_Map = map;
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
$"({m_Loc.m_X}, {m_Loc.m_Y}, {m_Loc.m_Z}, {m_Map?.ToString() ?? "(-null-)"})";
|
||||
|
||||
public bool Equals(WorldLocation other) =>
|
||||
m_Loc.Equals(other.m_Loc) && m_Map.MapID == other.m_Map.MapID;
|
||||
|
||||
public bool Equals(IEntity other) =>
|
||||
!ReferenceEquals(other, null) && m_Loc == other.Location &&
|
||||
m_Map.MapID == other.Map.MapID;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is WorldLocation other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(m_Loc, m_Map);
|
||||
|
||||
public int CompareTo(WorldLocation other)
|
||||
{
|
||||
var locComparison = m_Loc.CompareTo(other.m_Loc);
|
||||
if (locComparison != 0) return locComparison;
|
||||
return Comparer<Map>.Default.Compare(m_Map, other.m_Map);
|
||||
}
|
||||
|
||||
public static implicit operator Point3D(WorldLocation worldLocation) => worldLocation.Location;
|
||||
|
||||
public static bool operator ==(WorldLocation l, WorldLocation r) =>
|
||||
l.m_Loc == r.m_Loc && l.m_Map == r.m_Map;
|
||||
|
||||
public static bool operator ==(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc == r.Location && l.m_Map == r.Map;
|
||||
|
||||
public static bool operator !=(WorldLocation l, WorldLocation r) => l.m_Loc != r.m_Loc && l.m_Map != r.m_Map;
|
||||
|
||||
public static bool operator !=(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc != r.Location && l.m_Map != r.Map;
|
||||
|
||||
public static bool operator >(WorldLocation l, WorldLocation r) => l.m_Loc > r.m_Loc && l.m_Map == r.m_Map;
|
||||
|
||||
public static bool operator >(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc > r.Location && l.m_Map == r.Map;
|
||||
|
||||
public static bool operator <(WorldLocation l, WorldLocation r) => l.m_Loc < r.m_Loc && l.m_Map == r.m_Map;
|
||||
|
||||
public static bool operator <(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc < r.Location && l.m_Map == r.Map;
|
||||
|
||||
public static bool operator >=(WorldLocation l, WorldLocation r) => l.m_Loc >= r.m_Loc && l.m_Map == r.m_Map;
|
||||
|
||||
public static bool operator >=(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc >= r.Location && l.m_Map == r.Map;
|
||||
|
||||
public static bool operator <=(WorldLocation l, WorldLocation r) => l.m_Loc <= r.m_Loc && l.m_Map == r.m_Map;
|
||||
|
||||
public static bool operator <=(WorldLocation l, IEntity r) =>
|
||||
!ReferenceEquals(r, null) && l.m_Loc <= r.Location && l.m_Map == r.Map;
|
||||
|
||||
public static WorldLocation Parse(string value)
|
||||
{
|
||||
var start = value.IndexOf('(');
|
||||
var end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int x);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int y);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(',', start + 1);
|
||||
|
||||
Utility.ToInt32(value.Substring(start + 1, end - (start + 1)).Trim(), out int z);
|
||||
|
||||
start = end;
|
||||
end = value.IndexOf(')', start + 1);
|
||||
|
||||
var map = Map.Parse(value.Substring(start + 1, end - (start + 1)).Trim());
|
||||
|
||||
return new WorldLocation(x, y, z, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: WorldLocationConverter.cs *
|
||||
* Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Server.Json
|
||||
{
|
||||
public class WorldLocationConverter : JsonConverter<WorldLocation>
|
||||
{
|
||||
private WorldLocation DeserializeArray(ref Utf8JsonReader reader)
|
||||
{
|
||||
Span<int> data = stackalloc int[3];
|
||||
var count = 0;
|
||||
bool hasMap = false;
|
||||
Map map = null;
|
||||
|
||||
while (true)
|
||||
{
|
||||
reader.Read();
|
||||
if (reader.TokenType == JsonTokenType.EndArray)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.Number)
|
||||
{
|
||||
if (count < 3)
|
||||
data[count] = reader.GetInt32();
|
||||
else if (count == 3)
|
||||
map = Map.Maps[reader.GetInt32()];
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
if (reader.TokenType == JsonTokenType.String)
|
||||
{
|
||||
map = Map.Parse(reader.GetString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasMap || count < 3 || count > 4)
|
||||
throw new JsonException("WorldLocation must be an array of x, y, z, and map");
|
||||
|
||||
return new WorldLocation(data[0], data[1], data[2], map);
|
||||
}
|
||||
|
||||
private WorldLocation DeserializeObj(ref Utf8JsonReader reader, JsonSerializerOptions options)
|
||||
{
|
||||
Span<int> data = stackalloc int[3];
|
||||
int count = 0;
|
||||
bool hasLoc = false;
|
||||
bool hasXYZ = false;
|
||||
bool hasMap = false;
|
||||
Map map = null;
|
||||
|
||||
while (true)
|
||||
{
|
||||
reader.Read();
|
||||
if (reader.TokenType == JsonTokenType.EndObject)
|
||||
break;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.PropertyName)
|
||||
throw new JsonException("Invalid Json structure for WorldLocation object");
|
||||
|
||||
var key = reader.GetString();
|
||||
|
||||
var i = key switch
|
||||
{
|
||||
"x" => 0,
|
||||
"y" => 1,
|
||||
"z" => 2,
|
||||
"loc" => 3,
|
||||
"map" => 4,
|
||||
_ => 5
|
||||
};
|
||||
|
||||
if (i == 5)
|
||||
continue;
|
||||
|
||||
reader.Read();
|
||||
|
||||
if (i < 3)
|
||||
{
|
||||
if (hasLoc)
|
||||
throw new JsonException("WorldLocation must have loc or x, y, z, but not both");
|
||||
|
||||
if (reader.TokenType != JsonTokenType.Number)
|
||||
throw new JsonException($"Value for {key} must be a number");
|
||||
|
||||
hasXYZ = true;
|
||||
data[i] = reader.GetInt32();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i == 3)
|
||||
{
|
||||
if (hasXYZ)
|
||||
throw new JsonException("WorldLocation must have loc or x, y, z, but not both");
|
||||
|
||||
hasLoc = true;
|
||||
Point3D loc = new Point3DConverter().Read(ref reader, typeof(Point3D), options);
|
||||
data[0] = loc.X;
|
||||
data[1] = loc.Y;
|
||||
data[2] = loc.Z;
|
||||
count = 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
map = reader.TokenType switch
|
||||
{
|
||||
JsonTokenType.String => Map.Parse(reader.GetString()),
|
||||
JsonTokenType.Number => Map.Maps[reader.GetInt32()],
|
||||
_ => throw new JsonException($"Value for {key} must be a number or string")
|
||||
};
|
||||
}
|
||||
|
||||
if (!hasMap || count < 2)
|
||||
throw new JsonException("WorldLocation must have an x, y, z, and map properties");
|
||||
|
||||
return new WorldLocation(data[0], data[1], data[2], map);
|
||||
}
|
||||
|
||||
public override WorldLocation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
|
||||
reader.TokenType switch
|
||||
{
|
||||
JsonTokenType.StartArray => DeserializeArray(ref reader),
|
||||
JsonTokenType.StartObject => DeserializeObj(ref reader, options),
|
||||
_ => throw new JsonException("Invalid Json for Point3D")
|
||||
};
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, WorldLocation value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteNumberValue(value.X);
|
||||
writer.WriteNumberValue(value.Y);
|
||||
writer.WriteNumberValue(value.Z);
|
||||
writer.WriteStringValue(value.Map.ToString());
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019-2020 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: WorldLocationConverterFactory.cs *
|
||||
* Created: 2020/05/31 - Updated: 2020/05/31 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Server.Json
|
||||
{
|
||||
public class WorldLocationConverterFactory : JsonConverterFactory
|
||||
{
|
||||
public override bool CanConvert(Type typeToConvert) => typeToConvert == typeof(WorldLocation);
|
||||
|
||||
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) => new WorldLocationConverter();
|
||||
}
|
||||
}
|
||||
|
|
@ -20,33 +20,50 @@
|
|||
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Server.Json
|
||||
{
|
||||
public static class JsonConfig
|
||||
{
|
||||
public static readonly JsonSerializerOptions Options = new JsonSerializerOptions
|
||||
public static readonly JsonSerializerOptions DefaultOptions = GetOptions();
|
||||
|
||||
public static JsonSerializerOptions GetOptions(params JsonConverterFactory[] converters)
|
||||
{
|
||||
ReadCommentHandling = JsonCommentHandling.Skip,
|
||||
WriteIndented = true,
|
||||
AllowTrailingCommas = true,
|
||||
IgnoreNullValues = true
|
||||
};
|
||||
// In the future this should be optimized by cloning DefaultOptions
|
||||
var options = new JsonSerializerOptions
|
||||
{
|
||||
ReadCommentHandling = JsonCommentHandling.Skip,
|
||||
WriteIndented = true,
|
||||
AllowTrailingCommas = true,
|
||||
IgnoreNullValues = true
|
||||
};
|
||||
|
||||
options.Converters.Add(new MapConverterFactory());
|
||||
options.Converters.Add(new Point3DConverterFactory());
|
||||
options.Converters.Add(new Rectangle3DConverterFactory());
|
||||
options.Converters.Add(new TimeSpanConverterFactory());
|
||||
|
||||
for (int i = 0; i < converters.Length; i++) options.Converters.Add(converters[i]);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
public static T Deserialize<T>(string filePath, JsonSerializerOptions options = null)
|
||||
{
|
||||
if (!File.Exists(filePath)) return default;
|
||||
string text = File.ReadAllText(filePath, Utility.UTF8);
|
||||
return JsonSerializer.Deserialize<T>(text, options ?? Options);
|
||||
return JsonSerializer.Deserialize<T>(text, options ?? DefaultOptions);
|
||||
}
|
||||
|
||||
public static void Serialize(string filePath, object value, JsonSerializerOptions options = null)
|
||||
{
|
||||
if (File.Exists(filePath)) File.Delete(filePath);
|
||||
|
||||
File.WriteAllText(filePath, JsonSerializer.Serialize(value, options ?? Options));
|
||||
File.WriteAllText(filePath, JsonSerializer.Serialize(value, options ?? DefaultOptions));
|
||||
}
|
||||
|
||||
public static T ToObject<T>(this ref Utf8JsonReader reader, JsonSerializerOptions options = null) =>
|
||||
|
|
|
|||
|
|
@ -14,12 +14,6 @@ namespace Server
|
|||
{
|
||||
var path = Path.Join(Core.BaseDirectory, "Data/regions.json");
|
||||
|
||||
// Json Deserialization options for custom objects
|
||||
JsonSerializerOptions options = new JsonSerializerOptions();
|
||||
options.Converters.Add(new MapConverterFactory());
|
||||
options.Converters.Add(new Point3DConverterFactory());
|
||||
options.Converters.Add(new Rectangle3DConverterFactory());
|
||||
|
||||
List<string> failures = new List<string>();
|
||||
int count = 0;
|
||||
|
||||
|
|
@ -38,7 +32,7 @@ namespace Server
|
|||
continue;
|
||||
}
|
||||
|
||||
var region = ActivatorUtil.CreateInstance(type, json, options) as Region;
|
||||
var region = ActivatorUtil.CreateInstance(type, json, JsonConfig.DefaultOptions) as Region;
|
||||
region?.Register();
|
||||
count++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<StartupObject>Server.Core</StartupObject>
|
||||
<AssemblyName>ModernUO</AssemblyName>
|
||||
<Win32Resource />
|
||||
<Version>0.4.0</Version>
|
||||
<Version>0.5.0</Version>
|
||||
<Product>ModernUO Server</Product>
|
||||
<PublishDir>..\..\Distribution</PublishDir>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
<Delete Files="..\..\Distribution\zlib.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\libz.dylib" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\libz.so" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\ZLib.Bindings.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\Microsoft.AspNetCore.Connections.Abstractions.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\Microsoft.AspNetCore.Http.Features.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.dll" ContinueOnError="true" />
|
||||
|
|
@ -64,9 +65,9 @@
|
|||
<AdditionalFiles Include="..\..\stylecop.json">
|
||||
<Link>stylecop.json</Link>
|
||||
</AdditionalFiles>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.5" />
|
||||
<PackageReference Include="System.IO.Pipelines" Version="4.7.2" />
|
||||
<PackageReference Include="ZLib.Bindings" Version="1.0.2" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -4,36 +4,36 @@
|
|||
".NETCoreApp,Version=v3.1": {
|
||||
"Microsoft.AspNetCore.Connections.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.1.4, )",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "3F5O9gkTfK8lp9qiLkKBacNlTIKb6dGv8W7noHGb6QVw8Kt0OvSXH/hCI08Ao7GCehciI7wNA9c6lUqarLV92A==",
|
||||
"requested": "[3.1.5, )",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "d9QNKLjOIb+O8fW+Xolhw0ZpOP1nzJi822qthXUhZqzb1PpL/xD4tmZfeE6IRXlRmQOAKDKg38mDEDTaMPGy1w==",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Http.Features": "3.1.4",
|
||||
"Microsoft.AspNetCore.Http.Features": "3.1.5",
|
||||
"System.IO.Pipelines": "4.7.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.1.4, )",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "htKi6bBU13AxI3qsM21K0s82J43JAGPmPG/KTAvMHoFgba8/U32j2Y/4olWkFw8vRAGv302F6FnOOfe2eObfNA==",
|
||||
"requested": "[3.1.5, )",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "RmWkwrdmpquJa3Tvui4AhNEy+LeqeDgd85RPNjamwKNjVSUW+Yaz8n1pKPz4IiqDJ+3XfdmaLjP9TSVnXSDNuA==",
|
||||
"dependencies": {
|
||||
"Libuv": "1.10.0",
|
||||
"Microsoft.AspNetCore.Connections.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.Options": "3.1.4"
|
||||
"Microsoft.AspNetCore.Connections.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.Options": "3.1.5"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Hosting.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.1.4, )",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "w1Zildlb70fJ8qqysyt6HaueWBQ89qQmcSCsh/6+1TKmipU0AOjwduqY72eqHZ39j4jZYaXaoXQ/zqXZ1nYgCg==",
|
||||
"requested": "[3.1.5, )",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "e57iK9spITqHE7qNgC3IowzK+PK5NC2rmVY4Sz+ZoDNO24nIsgllIRbanSbt2wQz7Iy/N8Jm3C1sXqKc8zEOMQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.1.4"
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "3.1.5"
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines": {
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
"type": "Direct",
|
||||
"requested": "[1.0.2, )",
|
||||
"resolved": "1.0.2",
|
||||
"contentHash": "rd7gUFhwKb9Pd5ehhsUUdZiGS/AQQ1v0UItP2J+EYIfKzq7H54yDQ509qcBmbNtr6zTz7AAax4zRUcg3j9mfyQ=="
|
||||
"contentHash": "oMnRfnRHzfboCS/SXUrrqbDVtM/9h5LkHkB8GuyUq70BYkJRza7CNZxLR+F6IKOTNDcDO68VVCID4DA5Sj8c4Q=="
|
||||
},
|
||||
"Libuv": {
|
||||
"type": "Transitive",
|
||||
|
|
@ -58,58 +58,106 @@
|
|||
},
|
||||
"Microsoft.AspNetCore.Http.Features": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "HroyqnPK+g/GF+W3oLFQ2CfKS7BO/vzKhcgRAz3bovf3F/c3vR5Qw8AJEi0c+UVxyIhbFp00CdNR53Ghj+qckA==",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "I+G1L5363H2oCdMxHv2vtbluRgb4e33Gv6zJd8Uj93bBRFbE4MZlb3cB9PvRAYpSB0xbK216/qRtHmQJBzWIcg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "3.1.4",
|
||||
"Microsoft.Extensions.Primitives": "3.1.5",
|
||||
"System.IO.Pipelines": "4.7.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "k7IJME4US5S5JFOGYaei5TLwutp8IqUvcBWtliKXETGn/JScmCgfej21xq5+ttxi0qZhiyJY06y9dw+cLh3kiQ==",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "VBcAk6s9izZr04WCzNqOh1Sxz2RbVSh0G79MfpHSDv16cUJtSEYEHody9ZnF71LBEktzdu6cvDFBOFMh43q0iA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "3.1.4"
|
||||
"Microsoft.Extensions.Primitives": "3.1.5"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "AceHamXNKDMDwIoZqEoApLp8s3935wSC3VXrPaRWa0wWOaEcYdDlo1nWQ1zLiezoDmpJzV7FqDm53E0Ty/hEMg=="
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "2VSCj2TZPMdeEi279Lawi6qJQu4+sEWizSOYrhY6hapyS1jxn1jVUZT1Ugv68bya+x8+3lD4+RqhUZql9PhISQ=="
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "NNJA8JAoIaxlnb/bdQ8N0kA4T9ZaBAaUFM79pnT7j/x61Wne6K4lznU9u+NDgSAB3wrSx94mz169jNtle7KrSA==",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "LrEQ97jhSWw84Y1m+CJfvh9qTUUswt27au54QYn2x5PCMPPgR+yAv/4VTJKMGSSI9T4scSLBXZ/fVhT4fPTCtA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "3.1.4"
|
||||
"Microsoft.Extensions.Primitives": "3.1.5"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "JNPxhw2XwhjfGFyIkA5eBfzUDPNpa6Q50HJ2F6lCAMoSa1GquAktTrl4PhEyTYFNmu09B0E90WhYsUb3kmSkOA=="
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "ZvwowjRSWXewdPI+whPFXgwF4Qme6Q9KV9SCPEITSGiqHLArct7q5hTBtTzj3GPsVLjTqehvTg6Bd/EQk9JS0A=="
|
||||
},
|
||||
"Microsoft.Extensions.Options": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "ntWmD8i6UmAo0nn5MiCXIVl3+75aybVHgP/NxL9B16zwsbGkSfs+66BullsGEDNvrimgIFVDO+iB/h0yWfATWg==",
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "f+JT/7lkKBMp/Ak2tVjO+TD7o+UoCfjnExkZNn0PZIso8kIXrqNy6x42Lrxf4Q0pW3JMf9ExmL2EQlvk2XnFAg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.4",
|
||||
"Microsoft.Extensions.Primitives": "3.1.4"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.5",
|
||||
"Microsoft.Extensions.Primitives": "3.1.5"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.1.4",
|
||||
"contentHash": "tLR9n5ltwA56nr1t5M6q5IBfGLXtMS+XgumtqVENmtPQOWUD+m0Kgo1U6GWr06Y875WUN3sOGnmqkvW4an7fYA=="
|
||||
"resolved": "3.1.5",
|
||||
"contentHash": "6bLdjSAQix82oP2tsuX9MM2yjgUFFOkSZYyRSKoUULilw2cg0Y0H+dnugwYlfj8Jd7yjd/+QSdNBqEyYhTYv0w=="
|
||||
},
|
||||
"Microsoft.NETCore.Platforms": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.0.1",
|
||||
"contentHash": "2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ=="
|
||||
}
|
||||
},
|
||||
".NETCoreApp,Version=v3.1/linux-x64": {
|
||||
"ZLib.Bindings": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.0.2, )",
|
||||
"resolved": "1.0.2",
|
||||
"contentHash": "oMnRfnRHzfboCS/SXUrrqbDVtM/9h5LkHkB8GuyUq70BYkJRza7CNZxLR+F6IKOTNDcDO68VVCID4DA5Sj8c4Q=="
|
||||
},
|
||||
"Libuv": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.10.0",
|
||||
"contentHash": "GsCf4q+eyaI49rCPlgYxdxa1SQCysXFFdSJWdstrwxytg4+VPYLYrXD4AT2rjHVJ+UF7SSWX9CapWEYaU4ejVQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
".NETCoreApp,Version=v3.1/osx-x64": {
|
||||
"ZLib.Bindings": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.0.2, )",
|
||||
"resolved": "1.0.2",
|
||||
"contentHash": "oMnRfnRHzfboCS/SXUrrqbDVtM/9h5LkHkB8GuyUq70BYkJRza7CNZxLR+F6IKOTNDcDO68VVCID4DA5Sj8c4Q=="
|
||||
},
|
||||
"Libuv": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.10.0",
|
||||
"contentHash": "GsCf4q+eyaI49rCPlgYxdxa1SQCysXFFdSJWdstrwxytg4+VPYLYrXD4AT2rjHVJ+UF7SSWX9CapWEYaU4ejVQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
".NETCoreApp,Version=v3.1/win-x64": {
|
||||
"ZLib.Bindings": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.0.2, )",
|
||||
"resolved": "1.0.2",
|
||||
"contentHash": "oMnRfnRHzfboCS/SXUrrqbDVtM/9h5LkHkB8GuyUq70BYkJRza7CNZxLR+F6IKOTNDcDO68VVCID4DA5Sj8c4Q=="
|
||||
},
|
||||
"Libuv": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.10.0",
|
||||
"contentHash": "GsCf4q+eyaI49rCPlgYxdxa1SQCysXFFdSJWdstrwxytg4+VPYLYrXD4AT2rjHVJ+UF7SSWX9CapWEYaU4ejVQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue