Struct IRect
rectangle with intager data
Constructors
IRect(IRect)
Declaration
public IRect(IRect source)
IRect(Int2, Int2)
Declaration
public IRect(Int2 position, Int2 size)
IRect(int, int, int, int)
Declaration
public IRect(int xMin, int yMin, int width, int height)
Fields
height
Vertical size
Declaration
public int height
width
Horizontal size
Declaration
public int width
x
Left position
Declaration
public int x
y
Bottom position
Declaration
public int y
Properties
center
Declaration
public readonly Float2 center { get; }
max
Declaration
public Int2 max { readonly get; set; }
min
Declaration
public Int2 min { readonly get; set; }
position
Always return (x, y) no matter size is positive of negative
Declaration
public Int2 position { readonly get; set; }
size
(width, height)
Declaration
public Int2 size { readonly get; set; }
xMax
Declaration
public int xMax { readonly get; set; }
xMin
Declaration
public int xMin { readonly get; set; }
yMax
Declaration
public int yMax { readonly get; set; }
yMin
Declaration
public int yMin { readonly get; set; }
Methods
Contains(Int2)
True if the given position is inside this rectangle
Declaration
public readonly bool Contains(Int2 position)
Equals(IRect)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(IRect other)
Parameters
Type | Name | Description |
---|---|---|
IRect | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object other)
Returns
Type | Description |
---|---|
bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
MinMaxRect(Int2, Int2)
Create a rectangle with given min and max positions
Declaration
public static IRect MinMaxRect(Int2 min, Int2 max)
MinMaxRect(int, int, int, int)
Create a rectangle with given min and max positions
Declaration
public static IRect MinMaxRect(int minX, int minY, int maxX, int maxY)
Overlaps(IRect)
True if the given rectangle overlap with current one
Declaration
public readonly bool Overlaps(IRect other)
Point(Int2)
Create a rectangle with 1 in width and height
Declaration
public static IRect Point(Int2 pos)
Point(int, int)
Create a rectangle with 1 in width and height
Declaration
public static IRect Point(int x, int y)
SetMinMax(Int2, Int2)
Set value of this rectangle with min and max position
Declaration
public void SetMinMax(Int2 minPosition, Int2 maxPosition)
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
ToString(string)
Declaration
public readonly string ToString(string format)
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | The format to use. -or- A null reference ( |
IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
Type | Description |
---|---|
string | The value of the current instance in the specified format. |
Operators
operator ==(IRect, IRect)
Declaration
public static bool operator ==(IRect lhs, IRect rhs)
operator !=(IRect, IRect)
Declaration
public static bool operator !=(IRect lhs, IRect rhs)