yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_entrance_edit_policy.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_ENTRANCE_EDIT_POLICY_H_
2#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_ENTRANCE_EDIT_POLICY_H_
3
5
6namespace yaze::editor {
7
8inline constexpr char kDungeonSpawnReadOnlyReason[] =
9 "Spawn properties are read-only until the UI binds to the dedicated "
10 "DungeonSpawnPoint model.";
11
12inline bool CanEditDungeonEntrance(int slot_index,
13 const zelda3::RoomEntrance& entrance) {
14 return slot_index >= zelda3::kNumDungeonSpawnPoints &&
16 !entrance.is_spawn_point();
17}
18
19inline bool MarkDungeonEntranceDirtyIfEditable(int slot_index,
20 zelda3::RoomEntrance& entrance,
21 bool properties_changed) {
22 if (!properties_changed || !CanEditDungeonEntrance(slot_index, entrance)) {
23 return false;
24 }
25 entrance.MarkDirty();
26 return true;
27}
28
29} // namespace yaze::editor
30
31#endif // YAZE_APP_EDITOR_DUNGEON_DUNGEON_ENTRANCE_EDIT_POLICY_H_
Dungeon Room Entrance or Spawn Point.
Editors are the view controllers for the application.
bool CanEditDungeonEntrance(int slot_index, const zelda3::RoomEntrance &entrance)
constexpr char kDungeonSpawnReadOnlyReason[]
bool MarkDungeonEntranceDirtyIfEditable(int slot_index, zelda3::RoomEntrance &entrance, bool properties_changed)
constexpr int kNumDungeonSpawnPoints
constexpr int kNumDungeonEntranceSlots