Superfighters Deluxe
Area Struct Reference

Area More...

Inheritance diagram for Area:

Public Member Functions

 Area (float top, float left, float bottom, float right)
 Constructs a new Area More...
 
 Area (Vector2 min, Vector2 max)
 Constructs a new Area based on min/max points More...
 
bool Contains (Area area)
 Checks if this Area is contained within this. More...
 
bool Contains (float x, float y)
 Checks if this Area contains the given point More...
 
bool Contains (Vector2 point)
 Checks if this Area contains the given point More...
 
Area Copy ()
 Returns a copy of the area More...
 
bool Equals (Area other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
void Grow (float extent)
 Adjusts top/left/right/bottom with extent value while keeping center intact. More...
 
void Grow (float width, float height)
 Grows width and height with given values while keeping center intact. More...
 
bool Intersects (Area area)
 Checks if the Area intersects this. More...
 
void Move (Vector2 distance)
 Moves the Area the given distance. Results in:
Min += distance
Max += distance
More...
 
void Normalize ()
 Normalizes the Area. If the width or height happens to be negative this method will swap the Min/Max points so the width and height are positive. More...
 
void SetDimensions (float width, float height)
 Sets the width and height while keeping the center intact. More...
 
void SetHeight (float height)
 Sets the height while keeping the center intact. More...
 
void SetWidth (float width)
 Sets the width while keeping the center intact. More...
 
override string ToString ()
 

Static Public Member Functions

static Area Intersect (Area areaA, Area areaB)
 Returns the intersecting Area between two Areas. More...
 
static bool operator!= (Area areaA, Area areaB)
 
static bool operator== (Area areaA, Area areaB)
 
static Area Union (Area areaA, Area areaB)
 Returns the union Area between two Areas. More...
 

Properties

float Bottom [get, set]
 Gets or Sets the bottom side of the Area More...
 
Vector2 BottomLeft [get, set]
 Gets or Sets the bottom left corner of the Area More...
 
Vector2 BottomRight [get, set]
 Gets or Sets the bottom right corner of the Area More...
 
Vector2 Center [get]
 Returns the center point of the Area More...
 
float Height [get]
 Gets the height of the Area. Returns (Top - Bottom) More...
 
bool IsEmpty [get]
 Gets if this is an empty area where min and max equals zero More...
 
float Left [get, set]
 Gets or Sets the left side of the Area More...
 
Vector2 Max [get, set]
 Gets or Sets the Max point of the Area. This is the TopRight corner of the Area. More...
 
Vector2 Min [get, set]
 Gets or Sets the Min point of the Area. This is the BottomLeft corner of the Area. More...
 
float Right [get, set]
 Gets or Sets the right side of the Area More...
 
float Top [get, set]
 Gets or Sets the top side of the Area More...
 
Vector2 TopLeft [get, set]
 Gets or Sets the top left corner of the Area More...
 
Vector2 TopRight [get, set]
 Gets or Sets the top right corner of the Area More...
 
float Width [get]
 Gets the width of the Area. Returns (Right - Left) More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Area() [1/2]

Area ( float  top,
float  left,
float  bottom,
float  right 
)

Constructs a new Area

Parameters
topTop world coordinate of the Area.
leftLeft world coordinate of the Area.
bottomBottom world coordinate of the Area.
rightRight world coordinate of the Area.

◆ Area() [2/2]

Area ( Vector2  min,
Vector2  max 
)

Constructs a new Area based on min/max points

Parameters
minMin coordinate of the Area. Area BottomLeft = min
maxMax coordinate of the Area. Area TopRight = max

Member Function Documentation

◆ Contains() [1/3]

bool Contains ( Area  area)

Checks if this Area is contained within this.

Parameters
areaArea to check
Returns
true if Area is contained within this

◆ Contains() [2/3]

bool Contains ( float  x,
float  y 
)

Checks if this Area contains the given point

Parameters
xX
yY
Returns
true if the point is inside this Area

◆ Contains() [3/3]

bool Contains ( Vector2  point)

Checks if this Area contains the given point

Parameters
pointVector2 point to check
Returns
true if the point is inside this Area

◆ Copy()

Area Copy ( )

Returns a copy of the area

Returns

◆ Equals() [1/2]

bool Equals ( Area  other)

Parameters
other
Returns

◆ Equals() [2/2]

override bool Equals ( object  obj)

Parameters
obj
Returns

◆ GetHashCode()

override int GetHashCode ( )

Returns

◆ Grow() [1/2]

void Grow ( float  extent)

Adjusts top/left/right/bottom with extent value while keeping center intact.

◆ Grow() [2/2]

void Grow ( float  width,
float  height 
)

Grows width and height with given values while keeping center intact.

◆ Intersect()

static Area Intersect ( Area  areaA,
Area  areaB 
)
static

Returns the intersecting Area between two Areas.

Parameters
areaAArea A
areaBArea B
Returns
The intersection between Area A and B

◆ Intersects()

bool Intersects ( Area  area)

Checks if the Area intersects this.

Parameters
areaArea to check
Returns
true if it intersects

◆ Move()

void Move ( Vector2  distance)

Moves the Area the given distance. Results in:
Min += distance
Max += distance

Parameters
distanceVector2 movement

◆ Normalize()

void Normalize ( )

Normalizes the Area. If the width or height happens to be negative this method will swap the Min/Max points so the width and height are positive.

◆ operator!=()

static bool operator!= ( Area  areaA,
Area  areaB 
)
static

Parameters
areaA
areaB
Returns

◆ operator==()

static bool operator== ( Area  areaA,
Area  areaB 
)
static

Parameters
areaA
areaB
Returns

◆ SetDimensions()

void SetDimensions ( float  width,
float  height 
)

Sets the width and height while keeping the center intact.

◆ SetHeight()

void SetHeight ( float  height)

Sets the height while keeping the center intact.

◆ SetWidth()

void SetWidth ( float  width)

Sets the width while keeping the center intact.

◆ ToString()

override string ToString ( )

Returns

◆ Union()

static Area Union ( Area  areaA,
Area  areaB 
)
static

Returns the union Area between two Areas.

Parameters
areaAArea A
areaBArea B
Returns
The union

Property Documentation

◆ Bottom

float Bottom
getset

Gets or Sets the bottom side of the Area

◆ BottomLeft

Vector2 BottomLeft
getset

Gets or Sets the bottom left corner of the Area

◆ BottomRight

Vector2 BottomRight
getset

Gets or Sets the bottom right corner of the Area

◆ Center

Vector2 Center
get

Returns the center point of the Area

◆ Height

float Height
get

Gets the height of the Area. Returns (Top - Bottom)

◆ IsEmpty

bool IsEmpty
get

Gets if this is an empty area where min and max equals zero

◆ Left

float Left
getset

Gets or Sets the left side of the Area

◆ Max

Vector2 Max
getset

Gets or Sets the Max point of the Area. This is the TopRight corner of the Area.

◆ Min

Vector2 Min
getset

Gets or Sets the Min point of the Area. This is the BottomLeft corner of the Area.

◆ Right

float Right
getset

Gets or Sets the right side of the Area

◆ Top

float Top
getset

Gets or Sets the top side of the Area

◆ TopLeft

Vector2 TopLeft
getset

Gets or Sets the top left corner of the Area

◆ TopRight

Vector2 TopRight
getset

Gets or Sets the top right corner of the Area

◆ Width

float Width
get

Gets the width of the Area. Returns (Right - Left)