yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::zelda3::DungeonEditorSystem Class Reference

Core dungeon editing system. More...

#include <dungeon_editor_system.h>

Collaboration diagram for yaze::zelda3::DungeonEditorSystem:

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< RoomGetRoom (int room_id)
 
std::shared_ptr< DungeonObjectEditorGetObjectEditor ()
 
absl::Status Undo ()
 
absl::Status Redo ()
 
bool CanUndo () const
 
bool CanRedo () const
 
void ClearHistory ()
 
void SetRoomChangedCallback (RoomChangedCallback callback)
 
EditorState GetEditorState () const
 
RomGetROM () 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

Romrom_
 
GameDatagame_data_ = nullptr
 
std::shared_ptr< DungeonObjectEditorobject_editor_
 
EditorState editor_state_
 
std::unordered_map< int, Roomrooms_
 
RoomChangedCallback room_changed_callback_
 
std::vector< UndoPointundo_history_
 
std::vector< UndoPointredo_history_
 

Static Private Attributes

static constexpr size_t kMaxUndoHistory = 100
 

Detailed Description

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.

Member Typedef Documentation

◆ RoomChangedCallback

using yaze::zelda3::DungeonEditorSystem::RoomChangedCallback = std::function<void(int room_id)>

Definition at line 69 of file dungeon_editor_system.h.

Constructor & Destructor Documentation

◆ DungeonEditorSystem()

yaze::zelda3::DungeonEditorSystem::DungeonEditorSystem ( Rom * rom,
GameData * game_data = nullptr )
explicit

Definition at line 8 of file dungeon_editor_system.cc.

◆ ~DungeonEditorSystem()

yaze::zelda3::DungeonEditorSystem::~DungeonEditorSystem ( )
default

Member Function Documentation

◆ SetGameData()

void yaze::zelda3::DungeonEditorSystem::SetGameData ( GameData * game_data)
inline

Definition at line 44 of file dungeon_editor_system.h.

References game_data_.

◆ Initialize()

absl::Status yaze::zelda3::DungeonEditorSystem::Initialize ( )

Definition at line 11 of file dungeon_editor_system.cc.

References object_editor_, RETURN_IF_ERROR, and rom_.

◆ LoadDungeon()

◆ SaveDungeon()

absl::Status yaze::zelda3::DungeonEditorSystem::SaveDungeon ( )

◆ SaveRoom()

absl::Status yaze::zelda3::DungeonEditorSystem::SaveRoom ( int room_id)

Definition at line 46 of file dungeon_editor_system.cc.

References SaveRoomData().

Here is the call graph for this function:

◆ ReloadRoom()

absl::Status yaze::zelda3::DungeonEditorSystem::ReloadRoom ( int room_id)

Definition at line 50 of file dungeon_editor_system.cc.

References LoadRoomData().

Here is the call graph for this function:

◆ SetCurrentRoom()

absl::Status yaze::zelda3::DungeonEditorSystem::SetCurrentRoom ( int room_id)

◆ GetCurrentRoom()

int yaze::zelda3::DungeonEditorSystem::GetCurrentRoom ( ) const

◆ GetRoom()

◆ GetObjectEditor()

std::shared_ptr< DungeonObjectEditor > yaze::zelda3::DungeonEditorSystem::GetObjectEditor ( )

Definition at line 75 of file dungeon_editor_system.cc.

References object_editor_, and rom_.

◆ Undo()

absl::Status yaze::zelda3::DungeonEditorSystem::Undo ( )

Definition at line 82 of file dungeon_editor_system.cc.

References CanUndo(), and object_editor_.

Here is the call graph for this function:

◆ Redo()

absl::Status yaze::zelda3::DungeonEditorSystem::Redo ( )

Definition at line 94 of file dungeon_editor_system.cc.

References CanRedo(), and object_editor_.

Here is the call graph for this function:

◆ CanUndo()

bool yaze::zelda3::DungeonEditorSystem::CanUndo ( ) const

Definition at line 106 of file dungeon_editor_system.cc.

References undo_history_.

Referenced by Undo().

◆ CanRedo()

bool yaze::zelda3::DungeonEditorSystem::CanRedo ( ) const

Definition at line 108 of file dungeon_editor_system.cc.

References redo_history_.

Referenced by Redo().

◆ ClearHistory()

void yaze::zelda3::DungeonEditorSystem::ClearHistory ( )

Definition at line 110 of file dungeon_editor_system.cc.

References redo_history_, and undo_history_.

◆ SetRoomChangedCallback()

void yaze::zelda3::DungeonEditorSystem::SetRoomChangedCallback ( RoomChangedCallback callback)

Definition at line 115 of file dungeon_editor_system.cc.

References room_changed_callback_.

◆ GetEditorState()

DungeonEditorSystem::EditorState yaze::zelda3::DungeonEditorSystem::GetEditorState ( ) const

Definition at line 119 of file dungeon_editor_system.cc.

References editor_state_.

◆ GetROM()

Rom * yaze::zelda3::DungeonEditorSystem::GetROM ( ) const

Definition at line 123 of file dungeon_editor_system.cc.

References rom_.

◆ IsDirty()

bool yaze::zelda3::DungeonEditorSystem::IsDirty ( ) const

◆ SetROM()

void yaze::zelda3::DungeonEditorSystem::SetROM ( Rom * rom)

Definition at line 127 of file dungeon_editor_system.cc.

References object_editor_, and rom_.

◆ SetExternalRoom()

void yaze::zelda3::DungeonEditorSystem::SetExternalRoom ( Room * room)

Definition at line 134 of file dungeon_editor_system.cc.

References object_editor_.

◆ InitializeObjectEditor()

absl::Status yaze::zelda3::DungeonEditorSystem::InitializeObjectEditor ( )
private

Definition at line 140 of file dungeon_editor_system.cc.

References object_editor_, and rom_.

◆ LoadRoomData()

absl::Status yaze::zelda3::DungeonEditorSystem::LoadRoomData ( int room_id)
private

Definition at line 147 of file dungeon_editor_system.cc.

References rom_.

Referenced by ReloadRoom().

◆ SaveRoomData()

absl::Status yaze::zelda3::DungeonEditorSystem::SaveRoomData ( int room_id)
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().

Here is the call graph for this function:

Member Data Documentation

◆ rom_

Rom* yaze::zelda3::DungeonEditorSystem::rom_
private

◆ game_data_

GameData* yaze::zelda3::DungeonEditorSystem::game_data_ = nullptr
private

Definition at line 87 of file dungeon_editor_system.h.

Referenced by GetRoom(), and SetGameData().

◆ object_editor_

std::shared_ptr<DungeonObjectEditor> yaze::zelda3::DungeonEditorSystem::object_editor_
private

◆ editor_state_

EditorState yaze::zelda3::DungeonEditorSystem::editor_state_
private

◆ rooms_

std::unordered_map<int, Room> yaze::zelda3::DungeonEditorSystem::rooms_
private

Definition at line 93 of file dungeon_editor_system.h.

◆ room_changed_callback_

RoomChangedCallback yaze::zelda3::DungeonEditorSystem::room_changed_callback_
private

Definition at line 96 of file dungeon_editor_system.h.

Referenced by SetRoomChangedCallback().

◆ undo_history_

std::vector<UndoPoint> yaze::zelda3::DungeonEditorSystem::undo_history_
private

Definition at line 105 of file dungeon_editor_system.h.

Referenced by CanUndo(), and ClearHistory().

◆ redo_history_

std::vector<UndoPoint> yaze::zelda3::DungeonEditorSystem::redo_history_
private

Definition at line 106 of file dungeon_editor_system.h.

Referenced by CanRedo(), and ClearHistory().

◆ kMaxUndoHistory

constexpr size_t yaze::zelda3::DungeonEditorSystem::kMaxUndoHistory = 100
staticconstexprprivate

Definition at line 107 of file dungeon_editor_system.h.


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