Table of Contents

Struct Rectangle2D

Namespace
Moongate.UO.Data.Geometry
Assembly
Moongate.UO.Data.dll

Represents Rectangle2D.

public struct Rectangle2D : IEquatable<Rectangle2D>, ISpanFormattable, IFormattable, ISpanParsable<Rectangle2D>, IParsable<Rectangle2D>
Implements
Inherited Members

Constructors

Rectangle2D(Point2D, Point2D)

public Rectangle2D(Point2D start, Point2D end)

Parameters

start Point2D
end Point2D

Rectangle2D(int, int, int, int)

public Rectangle2D(int x, int y, int width, int height)

Parameters

x int
y int
width int
height int

Properties

Empty

public static Rectangle2D Empty { get; }

Property Value

Rectangle2D

End

public Point2D End { get; set; }

Property Value

Point2D

Height

public int Height { get; set; }

Property Value

int

Start

public Point2D Start { get; set; }

Property Value

Point2D

Width

public int Width { get; set; }

Property Value

int

X

public int X { get; set; }

Property Value

int

Y

public int Y { get; set; }

Property Value

int

Methods

Contains(Point2D)

public bool Contains(Point2D p)

Parameters

p Point2D

Returns

bool

Contains(Point3D)

public bool Contains(Point3D p)

Parameters

p Point3D

Returns

bool

Contains(int, int)

public bool Contains(int x, int y)

Parameters

x int
y int

Returns

bool

Equals(Rectangle2D)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Rectangle2D other)

Parameters

other Rectangle2D

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

MakeHold(Rectangle2D)

public void MakeHold(Rectangle2D r)

Parameters

r Rectangle2D

Parse(ReadOnlySpan<char>, IFormatProvider)

Parses a span of characters into a value.

public static Rectangle2D Parse(ReadOnlySpan<char> s, IFormatProvider provider)

Parameters

s ReadOnlySpan<char>

The span of characters to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

Rectangle2D

The result of parsing s.

Exceptions

FormatException

s is not in the correct format.

OverflowException

s is not representable by Rectangle2D.

Parse(string)

public static Rectangle2D Parse(string s)

Parameters

s string

Returns

Rectangle2D

Parse(string, IFormatProvider)

Parses a string into a value.

public static Rectangle2D Parse(string s, IFormatProvider provider)

Parameters

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

Rectangle2D

The result of parsing s.

Exceptions

ArgumentNullException

s is null.

FormatException

s is not in the correct format.

OverflowException

s is not representable by Rectangle2D.

Set(int, int, int, int)

public void Set(int x, int y, int width, int height)

Parameters

x int
y int
width int
height int

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(string, IFormatProvider)

Formats the value of the current instance using the specified format.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider)

Tries to format the value of the current instance into the provided span of characters.

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider)

Parameters

destination Span<char>

The span in which to write this instance's value formatted as a span of characters.

charsWritten int

When this method returns, contains the number of characters that were written in destination.

format ReadOnlySpan<char>

A span containing the characters that represent a standard or custom format string that defines the acceptable format for destination.

provider IFormatProvider

An optional object that supplies culture-specific formatting information for destination.

Returns

bool

true if the formatting was successful; otherwise, false.

TryParse(ReadOnlySpan<char>, IFormatProvider, out Rectangle2D)

Tries to parse a span of characters into a value.

public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out Rectangle2D result)

Parameters

s ReadOnlySpan<char>

The span of characters to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

result Rectangle2D

When this method returns, contains the result of successfully parsing s, or an undefined value on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.

TryParse(string, IFormatProvider, out Rectangle2D)

Tries to parse a string into a value.

public static bool TryParse(string s, IFormatProvider provider, out Rectangle2D result)

Parameters

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

result Rectangle2D

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.

Operators

operator ==(Rectangle2D, Rectangle2D)

public static bool operator ==(Rectangle2D l, Rectangle2D r)

Parameters

l Rectangle2D
r Rectangle2D

Returns

bool

operator !=(Rectangle2D, Rectangle2D)

public static bool operator !=(Rectangle2D l, Rectangle2D r)

Parameters

l Rectangle2D
r Rectangle2D

Returns

bool