Major refactoring for game objects
This commit is contained in:
1 parent
efb85f7328
commit
2cae9998a0
18 files changed
+547
-716
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "Item.h"
|
||||
|
||||
namespace ZL {
|
||||
|
||||
class ItemRegistry {
|
||||
public:
|
||||
static ItemRegistry& instance();
|
||||
|
||||
void loadFromJson(const std::string& jsonPath, const std::string& zipPath = "");
|
||||
|
||||
// Returns nullptr if not found.
|
||||
const Item* findById(const std::string& id) const;
|
||||
|
||||
private:
|
||||
ItemRegistry() = default;
|
||||
|
||||
std::unordered_map<std::string, Item> items_;
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
Reference in new issue
Block a user