RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Generation.RectRoom Class Reference

Represents a rectangular room in a dungeon. More...

Collaboration diagram for RpgGame.Generation.RectRoom:

Public Member Functions

 RectRoom (int x, int y, int width, int height)
 Initializes a new rectangular room.
 
bool Intersects (RectRoom other)
 Determines whether this room intersects with another room.
 

Properties

int X [get]
 Gets the x-coordinate of the room's top-left corner.
 
int Y [get]
 Gets the y-coordinate of the room's top-left corner.
 
int Width [get]
 Gets the width of the room in tiles.
 
int Height [get]
 Gets the height of the room in tiles.
 
Position Center [get]
 Gets the center position of the room.
 

Detailed Description

Represents a rectangular room in a dungeon.

This class is used during dungeon generation to track room boundaries and detect collisions between generated rooms.

Constructor & Destructor Documentation

◆ RectRoom()

RpgGame.Generation.RectRoom.RectRoom ( int  x,
int  y,
int  width,
int  height 
)
inline

Initializes a new rectangular room.

Parameters
xThe x-coordinate of the top-left corner.
yThe y-coordinate of the top-left corner.
widthThe room width in tiles.
heightThe room height in tiles.

Member Function Documentation

◆ Intersects()

bool RpgGame.Generation.RectRoom.Intersects ( RectRoom  other)
inline

Determines whether this room intersects with another room.

Parameters
otherThe room to check against.
Returns
True if the rooms intersect with a 2-tile buffer; otherwise, false.

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