| 79 | } |
| 80 | |
| 81 | Object* GetLoadedObject(ObjectType objectType, size_t index) override |
| 82 | { |
| 83 | // This is sometimes done deliberately (to avoid boilerplate), so no need to log_warn for this. |
| 84 | if (index == kObjectEntryIndexNull) |
| 85 | { |
| 86 | return nullptr; |
| 87 | } |
| 88 | |
| 89 | if (index >= static_cast<size_t>(getObjectEntryGroupCount(objectType))) |
| 90 | { |
| 91 | #if DEBUG > 0 |
| 92 | if (index != kObjectEntryIndexNull) |
| 93 | { |
| 94 | LOG_WARNING("Object index %u exceeds maximum for type %d.", index, objectType); |
| 95 | } |
| 96 | #endif |
| 97 | return nullptr; |
| 98 | } |
| 99 | |
| 100 | const auto& list = GetObjectList(objectType); |
| 101 | if (index >= list.size()) |
| 102 | { |
| 103 | return nullptr; |
| 104 | } |
| 105 | |
| 106 | return list[index]; |
| 107 | } |
| 108 | |
| 109 | Object* GetLoadedObject(const ObjectEntryDescriptor& entry) override |
| 110 | { |
no test coverage detected