Room Module

class Room.Room(x, y, width, height, tmp_kind=None)[source]

Bases: Rect.Rect

Room in dungeon. Once instantiated, it is filled with Tile.

east_road_id = None

The road id on east side. If not exist, None.

get_door(x, y)[source]

Get a door from Room.

Parameters:
  • x – potision x.
  • y – potision y.
Return type:

Door class.

Returns:

Return door. if it does not exist, return None.

get_east_door()[source]

Get a door on the east side.

Return type:Door
Returns:Return Door.
get_north_door()[source]

Get a door on the north side.

Return type:Door
Returns:Return Door.
get_south_door()[source]

Get a door on the south side.

Return type:Door
Returns:Return Door.
get_tile(x, y)[source]

Get a tile from Room.

Parameters:
  • x – potision x.
  • y – potision y.
Return type:

Tile class.

Returns:

Return tile. if it does not exist, return None.

get_wall(x, y)[source]

Get a wall from Room.

Parameters:
  • x – potision x.
  • y – potision y.
Return type:

Tile class.

Returns:

Return tile. if it does not exist, return None.

get_west_door()[source]

Get a door on the west side.

Return type:Door
Returns:Return Door.
has_door(door)[source]

Whether holds the door.

Parameters:
  • x – potision x.
  • y – potision y.
Return type:

Booean

Returns:

Return True, if holds the tile. Otherwise Fasle.

has_road = None

Whther the at least one of the road, or not.

has_tile(x, y)[source]

Whether holds the tile.

Parameters:
  • x – potision x.
  • y – potision y.
Return type:

Booean

Returns:

Return True, if holds the tile. Otherwise Fasle.

north_road_id = None

The road id on north side. If not exist, None.

set_tile(x, y, new_tile)[source]

Set a tile to Room.

Parameters:
  • x – potision x.
  • y – potision y.
  • new_tile – new Tile
south_road_id = None

The road id on south side. If not exist, None.

west_road_id = None

The road id on west side. If not exist, None.

Previous topic

Roads Module

Next topic

RoomSearcher Module

This Page