A* Pathfinding Project
4.1.23
The A* Pathfinding Project for Unity 3D
|
Integer Rectangle. More...
Integer Rectangle.
Works almost like UnityEngine.Rect but with integer coordinates
Public Member Functions | |
IntRect (int xmin, int ymin, int xmax, int ymax) | |
bool | Contains (int x, int y) |
void | DebugDraw (GraphTransform transform, Color color) |
Draws some debug lines representing the rect. More... | |
override bool | Equals (System.Object obj) |
IntRect | Expand (int range) |
Returns a new rect which is expanded by range in all directions. More... | |
IntRect | ExpandToContain (int x, int y) |
Returns a new IntRect which is expanded to contain the point. More... | |
override int | GetHashCode () |
bool | IsValid () |
Returns if this rectangle is valid. More... | |
override string | ToString () |
Static Public Member Functions | |
static IntRect | Intersection (IntRect a, IntRect b) |
Returns the intersection rect between the two rects. More... | |
static bool | Intersects (IntRect a, IntRect b) |
Returns if the two rectangles intersect each other. More... | |
static bool | operator!= (IntRect a, IntRect b) |
static bool | operator== (IntRect a, IntRect b) |
static IntRect | Union (IntRect a, IntRect b) |
Returns a new rect which contains both input rects. More... | |
Public Attributes | |
int | xmax |
int | xmin |
int | ymax |
int | ymin |
Properties | |
int | Height [get] |
int | Width [get] |
IntRect | ( | int | xmin, |
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
bool Contains | ( | int | x, |
int | y | ||
) |
void DebugDraw | ( | GraphTransform | transform, |
Color | color | ||
) |
Draws some debug lines representing the rect.
override bool Equals | ( | System.Object | obj | ) |
IntRect Expand | ( | int | range | ) |
Returns a new rect which is expanded by range in all directions.
range | How far to expand. Negative values are permitted. |
IntRect ExpandToContain | ( | int | x, |
int | y | ||
) |
Returns a new IntRect which is expanded to contain the point.
override int GetHashCode | ( | ) |
Returns the intersection rect between the two rects.
The intersection rect is the area which is inside both rects. If the rects do not have an intersection, an invalid rect is returned.
Returns if the two rectangles intersect each other.
bool IsValid | ( | ) |
Returns if this rectangle is valid.
An invalid rect could have e.g xmin > xmax. Rectamgles with a zero area area invalid.
override string ToString | ( | ) |
Returns a new rect which contains both input rects.
This rectangle may contain areas outside both input rects as well in some cases.
int xmax |
int xmin |
int ymax |
int ymin |
|
get |
|
get |