yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_object_registry.cc
Go to the documentation of this file.
2
3#include "absl/strings/str_format.h"
4
5namespace yaze {
6namespace zelda3 {
7
11
13 int16_t end_id) {
14 for (int16_t id = start_id; id <= end_id; ++id) {
15 if (registry_.find(id) == registry_.end()) {
16 registry_[id] = DungeonObjectInfo{.id = id,
17 .name = absl::StrFormat("Object 0x%03X", id),
18 .is_custom = false};
19 }
20 }
21}
22
24 const std::string& name) {
25 registry_[id] = DungeonObjectInfo{.id = id, .name = name, .is_custom = true};
26}
27
29 auto it = registry_.find(id);
30 if (it == registry_.end()) {
31 return nullptr;
32 }
33 return &it->second;
34}
35
36} // namespace zelda3
37} // namespace yaze
void RegisterCustomObject(int16_t id, const std::string &name)
const DungeonObjectInfo * Get(int16_t id) const
void RegisterObject(const DungeonObjectInfo &info)
void RegisterVanillaRange(int16_t start_id, int16_t end_id)
std::unordered_map< int16_t, DungeonObjectInfo > registry_