Represents a door in a dungeon room. More...
#include <room.h>
Public Member Functions | |
| std::pair< int, int > | GetTileCoords () const |
| Get tile coordinates for this door. | |
| std::pair< int, int > | GetPixelCoords () const |
| Get pixel coordinates for this door. | |
| DoorDimensions | GetDimensions () const |
| Get door dimensions in tiles. | |
| std::tuple< int, int, int, int > | GetBounds () const |
| Get bounding rectangle (x, y, width, height in pixels) | |
| std::string_view | GetTypeName () const |
| Get human-readable type name. | |
| std::string_view | GetDirectionName () const |
| Get human-readable direction name. | |
| std::pair< uint8_t, uint8_t > | EncodeBytes () const |
| Encode door data for ROM storage. | |
Static Public Member Functions | |
| static Door | FromRomBytes (uint8_t b1, uint8_t b2) |
Public Attributes | |
| uint8_t | position |
| Encoded position (5-bit, 0-31) | |
| DoorType | type |
| Door type (determines appearance/behavior) | |
| DoorDirection | direction |
| Which wall the door is on. | |
| uint8_t | byte1 |
| Original ROM byte 1 (position data) | |
| uint8_t | byte2 |
| Original ROM byte 2 (type + direction) | |
Represents a door in a dungeon room.
Doors connect rooms and can have various types (locked, bombable, etc.) They are placed at fixed positions along room walls.
|
inline |
Get tile coordinates for this door.
Definition at line 272 of file room.h.
References direction, position, and yaze::zelda3::DoorPositionManager::PositionToTileCoords().

|
inline |
Get pixel coordinates for this door.
Definition at line 277 of file room.h.
References direction, position, and yaze::zelda3::DoorPositionManager::PositionToPixelCoords().

|
inline |
Get door dimensions in tiles.
Definition at line 282 of file room.h.
References direction, and yaze::zelda3::GetDoorDimensions().

|
inline |
Get bounding rectangle (x, y, width, height in pixels)
Definition at line 287 of file room.h.
References direction, yaze::zelda3::DoorPositionManager::GetDoorBounds(), and position.

|
inline |
Get human-readable type name.
Definition at line 292 of file room.h.
References yaze::zelda3::GetDoorTypeName(), and type.

|
inline |
Get human-readable direction name.
Definition at line 297 of file room.h.
References direction, and yaze::zelda3::GetDoorDirectionName().

|
inline |
Encode door data for ROM storage.
Definition at line 302 of file room.h.
References direction, yaze::zelda3::DoorPositionManager::EncodeDoorBytes(), position, and type.
Referenced by yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().

|
inlinestatic |
Create a door from raw ROM bytes Format (from ASM RoomDraw_DoorObject): b1: bits 4-7 = position index, bits 0-1 = direction b2: door type (full byte, values 0x00, 0x02, 0x04, etc.)
Definition at line 310 of file room.h.
References byte1, byte2, direction, yaze::zelda3::DoorDirectionFromRaw(), yaze::zelda3::DoorTypeFromRaw(), position, and type.
Referenced by yaze::zelda3::Room::ParseObjectsFromLocation().

| uint8_t yaze::zelda3::Room::Door::position |
Encoded position (5-bit, 0-31)
Definition at line 264 of file room.h.
Referenced by EncodeBytes(), FromRomBytes(), GetBounds(), GetPixelCoords(), GetTileCoords(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().
| DoorType yaze::zelda3::Room::Door::type |
Door type (determines appearance/behavior)
Definition at line 265 of file room.h.
Referenced by EncodeBytes(), FromRomBytes(), GetTypeName(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().
| DoorDirection yaze::zelda3::Room::Door::direction |
Which wall the door is on.
Definition at line 266 of file room.h.
Referenced by EncodeBytes(), FromRomBytes(), GetBounds(), GetDimensions(), GetDirectionName(), GetPixelCoords(), GetTileCoords(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().
| uint8_t yaze::zelda3::Room::Door::byte1 |
Original ROM byte 1 (position data)
Definition at line 268 of file room.h.
Referenced by FromRomBytes(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().
| uint8_t yaze::zelda3::Room::Door::byte2 |
Original ROM byte 2 (type + direction)
Definition at line 269 of file room.h.
Referenced by FromRomBytes(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().