D2BS
Public Member Functions | Public Attributes

Room Class Reference

Represents a "Room" in the game. More...

List of all members.

Public Member Functions

bool getNext ()
 Move to the next Room.
bool reveal ()
 Reveal the Room on the map.
PresetUnit[] getPresetUnits (int nType=0, int nClass=0)
 Get the PresetUnit s from the current Room.
int[][] getCollision ()
 Get the collision data for the Room.
Room[] getNearby ()
 Get the "nearby" Rooms from pRoom2Near member.
int getStat (int nStat)
 Get some property of the Room.
Room getFirst ()
 Get the first Room of the level this Room is on.
bool unitInRoom (Unit unit)
 Determine whether or not the Unit is in the Room.

Public Attributes

int number
 Get the Room number.
int x
 Get the x coordinate of the Room.
int y
 Get the y coordinate of the Room.
int xsize
 Get the x size (width) of the Room.
int ysize
 Get the y size (height) of the Room.
int subnumber
 No implementation.
int area
 Get the Area ID for the area which the Room is in.
int level
 Get the Area ID for the area which the Room is in.
int correcttomb
 Get the correct tomb.

Detailed Description

Represents a "Room" in the game.

A Room is a rectangular piece of the map data. It has pointers to many lists, such as a list of PresetUnit s.


Member Function Documentation

int [][] Room::getCollision ( )

Get the collision data for the Room.

Todo:
Verify that the array does actually have reverse of usual dimensions.
Returns:
An array with the collision data. The first dimension is the y coordinate, the second is the x coordinate.
Room Room::getFirst ( )

Get the first Room of the level this Room is on.

Returns:
The first Room.
Room [] Room::getNearby ( )

Get the "nearby" Rooms from pRoom2Near member.

Returns:
An array of the nearby Rooms.
bool Room::getNext ( )

Move to the next Room.

Returns:
Whether there was another Room to move to or not.
PresetUnit [] Room::getPresetUnits ( int  nType = 0,
int  nClass = 0 
)

Get the PresetUnit s from the current Room.

Parameters:
nTypeThe type of Unit to get. See Unit::type.
nClassThe class id of the Unit (s) to find. See Unit::classId.
Returns:
An array of all the PresetUnit s from the current Room.
int Room::getStat ( int  nStat)

Get some property of the Room.

Parameters:
nStatWhich property to get:

0 - xStart (room 1)

1 - yStart (room 1)

2 - xSize (room 1)

3 - ySize (room 1)

4 - posX (room 2)

5 - posY (room 2)

6 - sizeX (room 2)

7 - sizeY (room 2)

9 - posGameX (coll)

10 - posGameY (coll)

11 - sizeGameX (coll)

12 - sizeGameY (coll)

13 - posRoomX (coll)

14 - posGameY (coll)

15 - sizeRoomX (coll)

16 - sizeRoomY (coll)

Returns:
The stat value.
bool Room::reveal ( )

Reveal the Room on the map.

Returns:
Whether or not the Room was successfully revealed.
bool Room::unitInRoom ( Unit  unit)

Determine whether or not the Unit is in the Room.

Parameters:
unitThe unit to check.
Returns:
Whether or not the Unit is in the Room.

Member Data Documentation

Get the correct tomb.

Todo:
Determine if this is the Area ID of the correct tomb.
Todo:
Determine what Room s this is valid on.

Get the Room number.

Todo:
Determine what a "room number" is.