Core dungeon editing system. More...
#include <dungeon_editor_system.h>

Classes | |
| struct | EditorState |
| struct | UndoPoint |
Public Types | |
| using | RoomChangedCallback = std::function<void(int room_id)> |
Public Member Functions | |
| DungeonEditorSystem (Rom *rom, GameData *game_data=nullptr) | |
| ~DungeonEditorSystem ()=default | |
| void | SetGameData (GameData *game_data) |
| absl::Status | Initialize () |
| absl::Status | LoadDungeon (int dungeon_id) |
| absl::Status | SaveDungeon () |
| absl::Status | SaveRoom (int room_id) |
| absl::Status | ReloadRoom (int room_id) |
| absl::Status | SetCurrentRoom (int room_id) |
| int | GetCurrentRoom () const |
| absl::StatusOr< Room > | GetRoom (int room_id) |
| std::shared_ptr< DungeonObjectEditor > | GetObjectEditor () |
| absl::Status | Undo () |
| absl::Status | Redo () |
| bool | CanUndo () const |
| bool | CanRedo () const |
| void | ClearHistory () |
| void | SetRoomChangedCallback (RoomChangedCallback callback) |
| EditorState | GetEditorState () const |
| Rom * | GetROM () const |
| bool | IsDirty () const |
| void | SetROM (Rom *rom) |
| void | SetExternalRoom (Room *room) |
Private Member Functions | |
| absl::Status | InitializeObjectEditor () |
| absl::Status | LoadRoomData (int room_id) |
| absl::Status | SaveRoomData (int room_id) |
Private Attributes | |
| Rom * | rom_ |
| GameData * | game_data_ = nullptr |
| std::shared_ptr< DungeonObjectEditor > | object_editor_ |
| EditorState | editor_state_ |
| std::unordered_map< int, Room > | rooms_ |
| RoomChangedCallback | room_changed_callback_ |
| std::vector< UndoPoint > | undo_history_ |
| std::vector< UndoPoint > | redo_history_ |
Static Private Attributes | |
| static constexpr size_t | kMaxUndoHistory = 100 |
Core dungeon editing system.
Provides dungeon editing functionality focused on:
Note: Sprite, item, door, chest, and entrance editing is handled directly by the Room class and UI panels, not by this system.
Definition at line 32 of file dungeon_editor_system.h.
| using yaze::zelda3::DungeonEditorSystem::RoomChangedCallback = std::function<void(int room_id)> |
Definition at line 69 of file dungeon_editor_system.h.
|
explicit |
Definition at line 8 of file dungeon_editor_system.cc.
|
default |
|
inline |
Definition at line 44 of file dungeon_editor_system.h.
References game_data_.
| absl::Status yaze::zelda3::DungeonEditorSystem::Initialize | ( | ) |
Definition at line 11 of file dungeon_editor_system.cc.
References object_editor_, RETURN_IF_ERROR, and rom_.
| absl::Status yaze::zelda3::DungeonEditorSystem::LoadDungeon | ( | int | dungeon_id | ) |
| absl::Status yaze::zelda3::DungeonEditorSystem::SaveDungeon | ( | ) |
Definition at line 30 of file dungeon_editor_system.cc.
References editor_state_, yaze::zelda3::DungeonEditorSystem::EditorState::is_dirty, yaze::zelda3::DungeonEditorSystem::EditorState::last_save_time, yaze::zelda3::NumberOfRooms, rom_, and SaveRoomData().

| absl::Status yaze::zelda3::DungeonEditorSystem::SaveRoom | ( | int | room_id | ) |
Definition at line 46 of file dungeon_editor_system.cc.
References SaveRoomData().

| absl::Status yaze::zelda3::DungeonEditorSystem::ReloadRoom | ( | int | room_id | ) |
Definition at line 50 of file dungeon_editor_system.cc.
References LoadRoomData().

| absl::Status yaze::zelda3::DungeonEditorSystem::SetCurrentRoom | ( | int | room_id | ) |
Definition at line 54 of file dungeon_editor_system.cc.
References yaze::zelda3::DungeonEditorSystem::EditorState::current_room_id, editor_state_, and yaze::zelda3::NumberOfRooms.
| int yaze::zelda3::DungeonEditorSystem::GetCurrentRoom | ( | ) | const |
Definition at line 63 of file dungeon_editor_system.cc.
References yaze::zelda3::DungeonEditorSystem::EditorState::current_room_id, and editor_state_.
| absl::StatusOr< Room > yaze::zelda3::DungeonEditorSystem::GetRoom | ( | int | room_id | ) |
Definition at line 67 of file dungeon_editor_system.cc.
References game_data_, yaze::zelda3::NumberOfRooms, and rom_.
Referenced by yaze::cli::handlers::DungeonListSpritesCommandHandler::Execute(), yaze::cli::handlers::DungeonDescribeRoomCommandHandler::Execute(), yaze::cli::handlers::DungeonExportRoomCommandHandler::Execute(), yaze::cli::handlers::DungeonListObjectsCommandHandler::Execute(), yaze::cli::handlers::DungeonGetRoomTilesCommandHandler::Execute(), and yaze::cli::handlers::DungeonSetRoomPropertyCommandHandler::Execute().
| std::shared_ptr< DungeonObjectEditor > yaze::zelda3::DungeonEditorSystem::GetObjectEditor | ( | ) |
Definition at line 75 of file dungeon_editor_system.cc.
References object_editor_, and rom_.
| absl::Status yaze::zelda3::DungeonEditorSystem::Undo | ( | ) |
Definition at line 82 of file dungeon_editor_system.cc.
References CanUndo(), and object_editor_.

| absl::Status yaze::zelda3::DungeonEditorSystem::Redo | ( | ) |
Definition at line 94 of file dungeon_editor_system.cc.
References CanRedo(), and object_editor_.

| bool yaze::zelda3::DungeonEditorSystem::CanUndo | ( | ) | const |
Definition at line 106 of file dungeon_editor_system.cc.
References undo_history_.
Referenced by Undo().
| bool yaze::zelda3::DungeonEditorSystem::CanRedo | ( | ) | const |
Definition at line 108 of file dungeon_editor_system.cc.
References redo_history_.
Referenced by Redo().
| void yaze::zelda3::DungeonEditorSystem::ClearHistory | ( | ) |
Definition at line 110 of file dungeon_editor_system.cc.
References redo_history_, and undo_history_.
| void yaze::zelda3::DungeonEditorSystem::SetRoomChangedCallback | ( | RoomChangedCallback | callback | ) |
Definition at line 115 of file dungeon_editor_system.cc.
References room_changed_callback_.
| DungeonEditorSystem::EditorState yaze::zelda3::DungeonEditorSystem::GetEditorState | ( | ) | const |
Definition at line 119 of file dungeon_editor_system.cc.
References editor_state_.
| Rom * yaze::zelda3::DungeonEditorSystem::GetROM | ( | ) | const |
Definition at line 123 of file dungeon_editor_system.cc.
References rom_.
| bool yaze::zelda3::DungeonEditorSystem::IsDirty | ( | ) | const |
Definition at line 125 of file dungeon_editor_system.cc.
References editor_state_, and yaze::zelda3::DungeonEditorSystem::EditorState::is_dirty.
| void yaze::zelda3::DungeonEditorSystem::SetROM | ( | Rom * | rom | ) |
Definition at line 127 of file dungeon_editor_system.cc.
References object_editor_, and rom_.
| void yaze::zelda3::DungeonEditorSystem::SetExternalRoom | ( | Room * | room | ) |
Definition at line 134 of file dungeon_editor_system.cc.
References object_editor_.
|
private |
Definition at line 140 of file dungeon_editor_system.cc.
References object_editor_, and rom_.
|
private |
Definition at line 147 of file dungeon_editor_system.cc.
References rom_.
Referenced by ReloadRoom().
|
private |
Definition at line 155 of file dungeon_editor_system.cc.
References object_editor_, rom_, and yaze::zelda3::Room::SaveObjects().
Referenced by SaveDungeon(), and SaveRoom().

|
private |
Definition at line 86 of file dungeon_editor_system.h.
Referenced by GetObjectEditor(), GetROM(), GetRoom(), Initialize(), InitializeObjectEditor(), LoadRoomData(), SaveDungeon(), SaveRoomData(), and SetROM().
|
private |
Definition at line 87 of file dungeon_editor_system.h.
Referenced by GetRoom(), and SetGameData().
|
private |
Definition at line 88 of file dungeon_editor_system.h.
Referenced by GetObjectEditor(), Initialize(), InitializeObjectEditor(), Redo(), SaveRoomData(), SetExternalRoom(), SetROM(), and Undo().
|
private |
Definition at line 90 of file dungeon_editor_system.h.
Referenced by GetCurrentRoom(), GetEditorState(), IsDirty(), LoadDungeon(), SaveDungeon(), and SetCurrentRoom().
|
private |
Definition at line 93 of file dungeon_editor_system.h.
|
private |
Definition at line 96 of file dungeon_editor_system.h.
Referenced by SetRoomChangedCallback().
|
private |
Definition at line 105 of file dungeon_editor_system.h.
Referenced by CanUndo(), and ClearHistory().
|
private |
Definition at line 106 of file dungeon_editor_system.h.
Referenced by CanRedo(), and ClearHistory().
|
staticconstexprprivate |
Definition at line 107 of file dungeon_editor_system.h.