yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_dungeon_state.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_EDITOR_DUNGEON_STATE_H
2#define YAZE_ZELDA3_DUNGEON_EDITOR_DUNGEON_STATE_H
3
4#include <map>
6
7namespace yaze {
8class Rom;
9namespace zelda3 {
10struct GameData;
11
19 public:
20 EditorDungeonState(Rom* rom, GameData* game_data) : rom_(rom), game_data_(game_data) {}
21
22 // Chest State
23 bool IsChestOpen(int room_id, int chest_index) const override {
24 auto it = chest_states_.find({room_id, chest_index});
25 if (it != chest_states_.end()) {
26 return it->second;
27 }
28 return false; // Default closed
29 }
30
31 void SetChestOpen(int room_id, int chest_index, bool open) {
32 chest_states_[{room_id, chest_index}] = open;
33 }
34
35 bool IsBigChestOpen() const override { return big_chest_open_; }
36 void SetBigChestOpen(bool open) { big_chest_open_ = open; }
37
38 // Door State
39 bool IsDoorOpen(int room_id, int door_index) const override {
40 auto it = door_states_.find({room_id, door_index});
41 if (it != door_states_.end()) {
42 return it->second;
43 }
44 return false; // Default closed
45 }
46
47 void SetDoorOpen(int room_id, int door_index, bool open) {
48 door_states_[{room_id, door_index}] = open;
49 }
50
51 bool IsDoorSwitchActive(int room_id) const override {
52 auto it = door_switch_states_.find(room_id);
53 if (it != door_switch_states_.end()) {
54 return it->second;
55 }
56 return false; // Default inactive
57 }
58
59 void SetDoorSwitchActive(int room_id, bool active) {
60 door_switch_states_[room_id] = active;
61 }
62
63 bool IsWaterFaceActive(int room_id) const override {
64 auto it = water_face_active_states_.find(room_id);
65 if (it != water_face_active_states_.end()) {
66 return it->second;
67 }
68 return false;
69 }
70
71 void SetWaterFaceActive(int room_id, bool active) {
72 water_face_active_states_[room_id] = active;
73 }
74
75 // Object State
76 bool IsWallMoved(int room_id) const override {
77 auto it = wall_moved_states_.find(room_id);
78 if (it != wall_moved_states_.end()) {
79 return it->second;
80 }
81 return false; // Default not moved
82 }
83
84 void SetWallMoved(int room_id, bool moved) {
85 wall_moved_states_[room_id] = moved;
86 }
87
88 bool IsFloorBombable(int room_id) const override {
89 auto it = floor_bombable_states_.find(room_id);
90 if (it != floor_bombable_states_.end()) {
91 return it->second;
92 }
93 return false; // Default solid
94 }
95
96 void SetFloorBombable(int room_id, bool bombed) {
97 floor_bombable_states_[room_id] = bombed;
98 }
99
100 bool IsRupeeFloorActive(int room_id) const override {
101 auto it = rupee_floor_states_.find(room_id);
102 if (it != rupee_floor_states_.end()) {
103 return it->second;
104 }
105 return false; // Default hidden/inactive
106 }
107
108 void SetRupeeFloorActive(int room_id, bool active) {
109 rupee_floor_states_[room_id] = active;
110 }
111
112 // General Flags
113 bool IsCrystalSwitchBlue() const override { return crystal_switch_blue_; }
114 void SetCrystalSwitchBlue(bool blue) { crystal_switch_blue_ = blue; }
115
116 // Reset all state
117 void Reset() {
118 chest_states_.clear();
119 big_chest_open_ = false;
120 door_states_.clear();
121 door_switch_states_.clear();
123 wall_moved_states_.clear();
125 rupee_floor_states_.clear();
126 crystal_switch_blue_ = true; // Default blue
127 }
128
129 private:
132
133 // State storage
134 std::map<std::pair<int, int>, bool> chest_states_;
135 bool big_chest_open_ = false;
136
137 std::map<std::pair<int, int>, bool> door_states_;
138 std::map<int, bool> door_switch_states_;
139 std::map<int, bool> water_face_active_states_;
140
141 std::map<int, bool> wall_moved_states_;
142 std::map<int, bool> floor_bombable_states_;
143 std::map<int, bool> rupee_floor_states_;
144
146};
147
148} // namespace zelda3
149} // namespace yaze
150
151#endif // YAZE_ZELDA3_DUNGEON_EDITOR_DUNGEON_STATE_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Interface for accessing dungeon game state.
Editor implementation of DungeonState.
void SetFloorBombable(int room_id, bool bombed)
bool IsChestOpen(int room_id, int chest_index) const override
bool IsWallMoved(int room_id) const override
void SetWaterFaceActive(int room_id, bool active)
bool IsFloorBombable(int room_id) const override
bool IsWaterFaceActive(int room_id) const override
std::map< std::pair< int, int >, bool > chest_states_
EditorDungeonState(Rom *rom, GameData *game_data)
void SetDoorOpen(int room_id, int door_index, bool open)
void SetRupeeFloorActive(int room_id, bool active)
void SetChestOpen(int room_id, int chest_index, bool open)
bool IsDoorSwitchActive(int room_id) const override
void SetWallMoved(int room_id, bool moved)
std::map< int, bool > floor_bombable_states_
bool IsRupeeFloorActive(int room_id) const override
std::map< int, bool > water_face_active_states_
void SetDoorSwitchActive(int room_id, bool active)
bool IsDoorOpen(int room_id, int door_index) const override
std::map< std::pair< int, int >, bool > door_states_