Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
KatanaEngine::Region Class Reference

Defines a rectangular region defined by a point, height, width. More...

#include <Region.h>

Public Member Functions

 Region ()
 Instantiates a new Region object.
 
 Region (const Point position, const Point size)
 Instantiates a new Region object.
 
 Region (const Point position, const int width, const int height)
 Instantiates a new Region object.
 
 Region (const int x, const int y, const int width, const int height)
 Instantiates a new Region object.
 
virtual ~Region ()
 
void Set (const int x, const int y, const int width, const int height)
 Sets the components of the region.
 
int GetTop ()
 The top of the region.
 
int GetBottom ()
 The bottom of the region.
 
int GetLeft ()
 The left side of the region.
 
int GetRight ()
 The right side of the region.
 
Point GetTopLeft ()
 The top left corner of the region.
 
Point GetTopRight ()
 The top right corner of the region.
 
Point GetBottomLeft ()
 The bottom left corner of the region.
 
Point GetBottomRight ()
 The bottom right corner of the region.
 
Vector2 GetCenter ()
 The center position of the region.
 
void Translate (const int x, const int y)
 Moves the region by the specified amount.
 
void Translate (const Point &point)
 Moves the region by the specified amount.
 

Public Attributes

int X = 0
 The left side of the region.
 
int Y = 0
 The top of the region.
 
int Width = 1
 The width of the region.
 
int Height = 1
 The height of the region.
 

Detailed Description

Defines a rectangular region defined by a point, height, width.

Definition at line 20 of file Region.h.

Constructor & Destructor Documentation

◆ Region() [1/4]

KatanaEngine::Region::Region ( )
inline

Instantiates a new Region object.

Definition at line 26 of file Region.h.

◆ Region() [2/4]

KatanaEngine::Region::Region ( const Point position,
const Point size )
inline

Instantiates a new Region object.

Parameters
positionthe upper left corner of the region.
sizeThe dimensions of the region.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 34 of file Region.h.

◆ Region() [3/4]

KatanaEngine::Region::Region ( const Point position,
const int width,
const int height )
inline

Instantiates a new Region object.

Parameters
positionthe upper left corner of the region.
widthThe width of the region.
heightThe height of the region.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 43 of file Region.h.

◆ Region() [4/4]

KatanaEngine::Region::Region ( const int x,
const int y,
const int width,
const int height )
inline

Instantiates a new Region object.

Parameters
xThe left side of the region.
yThe top side of the region.
widthThe width of the region.
heightThe height of the region.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 53 of file Region.h.

◆ ~Region()

virtual KatanaEngine::Region::~Region ( )
inlinevirtual

Definition at line 58 of file Region.h.

Member Function Documentation

◆ GetBottom()

int KatanaEngine::Region::GetBottom ( )
inline

The bottom of the region.

Returns
Returns the bottom.

Definition at line 81 of file Region.h.

◆ GetBottomLeft()

Point KatanaEngine::Region::GetBottomLeft ( )
inline

The bottom left corner of the region.

Returns
Returns the bottom left corner.

Definition at line 102 of file Region.h.

◆ GetBottomRight()

Point KatanaEngine::Region::GetBottomRight ( )
inline

The bottom right corner of the region.

Returns
Returns the bottom right corner.

Definition at line 106 of file Region.h.

◆ GetCenter()

Vector2 KatanaEngine::Region::GetCenter ( )
inline

The center position of the region.

Returns
Returns the center position.

Definition at line 110 of file Region.h.

◆ GetLeft()

int KatanaEngine::Region::GetLeft ( )
inline

The left side of the region.

Returns
Returns the left side.

Definition at line 85 of file Region.h.

◆ GetRight()

int KatanaEngine::Region::GetRight ( )
inline

The right side of the region.

Returns
Returns the right side.

Definition at line 89 of file Region.h.

◆ GetTop()

int KatanaEngine::Region::GetTop ( )
inline

The top of the region.

Returns
Returns the top.

Definition at line 77 of file Region.h.

◆ GetTopLeft()

Point KatanaEngine::Region::GetTopLeft ( )
inline

The top left corner of the region.

Returns
Returns the top left corner.

Definition at line 94 of file Region.h.

◆ GetTopRight()

Point KatanaEngine::Region::GetTopRight ( )
inline

The top right corner of the region.

Returns
Returns the top right corner.

Definition at line 98 of file Region.h.

◆ Set()

void KatanaEngine::Region::Set ( const int x,
const int y,
const int width,
const int height )
inline

Sets the components of the region.

Parameters
xThe left side of the region.
yThe top side of the region.
widthThe width of the region.
heightThe height of the region.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 67 of file Region.h.

◆ Translate() [1/2]

void KatanaEngine::Region::Translate ( const int x,
const int y )
inline

Moves the region by the specified amount.

Parameters
xThe amount to move the region on the x-axis.
yThe amount to move the region on the y-axis.

Definition at line 115 of file Region.h.

◆ Translate() [2/2]

void KatanaEngine::Region::Translate ( const Point & point)
inline

Moves the region by the specified amount.

Parameters
pointThe amount to move the region.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 125 of file Region.h.

Member Data Documentation

◆ Height

int KatanaEngine::Region::Height = 1

The height of the region.

Definition at line 135 of file Region.h.

◆ Width

int KatanaEngine::Region::Width = 1

The width of the region.

Definition at line 134 of file Region.h.

◆ X

int KatanaEngine::Region::X = 0

The left side of the region.

Definition at line 132 of file Region.h.

◆ Y

int KatanaEngine::Region::Y = 0

The top of the region.

Definition at line 133 of file Region.h.


The documentation for this class was generated from the following file: