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] =
18 .name = absl::StrFormat("Object 0x%03X", id),
19 .is_custom = false};
20 }
21 }
22}
23
25 const std::string& name) {
26 registry_[id] = DungeonObjectInfo{.id = id, .name = name, .is_custom = true};
27}
28
30 auto it = registry_.find(id);
31 if (it == registry_.end()) {
32 return nullptr;
33 }
34 return &it->second;
35}
36
37} // namespace zelda3
38} // 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_