Table of Contents

Class JsonCoordinate

Namespace
Moongate.UO.Data.Json
Assembly
Moongate.UO.Data.dll

Represents a coordinate in the JSON format (x1, y1, x2, y2)

public class JsonCoordinate
Inheritance
JsonCoordinate
Inherited Members

Properties

Area

Gets the area of the coordinate rectangle

[JsonIgnore]
public int Area { get; }

Property Value

int

Height

Gets the height of the coordinate rectangle

[JsonIgnore]
public int Height { get; }

Property Value

int

Width

Gets the width of the coordinate rectangle

[JsonIgnore]
public int Width { get; }

Property Value

int

X1

[JsonPropertyName("x1")]
public int X1 { get; set; }

Property Value

int

X2

[JsonPropertyName("x2")]
public int X2 { get; set; }

Property Value

int

Y1

[JsonPropertyName("y1")]
public int Y1 { get; set; }

Property Value

int

Y2

[JsonPropertyName("y2")]
public int Y2 { get; set; }

Property Value

int

Methods

Contains(int, int)

Checks if a point is within this coordinate rectangle

public bool Contains(int x, int y)

Parameters

x int

X coordinate

y int

Y coordinate

Returns

bool

True if the point is within the rectangle

FromRectangle2D(Rectangle2D)

Creates a JsonCoordinate from a Rectangle2D

public static JsonCoordinate FromRectangle2D(Rectangle2D rect)

Parameters

rect Rectangle2D

The Rectangle2D to convert

Returns

JsonCoordinate

JsonCoordinate with x1, y1, x2, y2

ToRectangle2D()

Converts this coordinate to a Rectangle2D

public Rectangle2D ToRectangle2D()

Returns

Rectangle2D

Rectangle2D with x, y, width, height

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.