Initial commit
This commit is contained in:
28
src/Library/ItemLibrary.hpp
Normal file
28
src/Library/ItemLibrary.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef CREATURELIB_ITEMLIBRARY_HPP
|
||||
#define CREATURELIB_ITEMLIBRARY_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "Items/Item.hpp"
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
class ItemLibrary {
|
||||
private:
|
||||
std::unordered_map<std::string, const Item *> _items;
|
||||
public:
|
||||
ItemLibrary() = default;
|
||||
~ItemLibrary(){
|
||||
_items.clear();
|
||||
}
|
||||
|
||||
[[nodiscard]] const Item* GetItem(const std::string& name) const;
|
||||
[[nodiscard]] const Item* operator[] (const std::string& name) const;
|
||||
|
||||
void LoadItem(const std::string& name, const Item* item);
|
||||
void DeleteItem(const std::string& name);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_ITEMLIBRARY_HPP
|
||||
Reference in New Issue
Block a user