23 lines
896 B
C++
23 lines
896 B
C++
#ifndef PKMNLIB_ITEMLIBRARY_HPP
|
|
#define PKMNLIB_ITEMLIBRARY_HPP
|
|
|
|
#include <CreatureLib/Library/ItemLibrary.hpp>
|
|
#include "Item.hpp"
|
|
namespace PkmnLib::Library {
|
|
class ItemLibrary : public CreatureLib::Library::ItemLibrary {
|
|
public:
|
|
inline bool TryGetItem(const std::string& name, const Item*& item) const {
|
|
return CreatureLib::Library::ItemLibrary::TryGetItem(name, (const CreatureLib::Library::Item*&)item);
|
|
}
|
|
const Item* GetItem(const std::string& name) const {
|
|
return reinterpret_cast<const Item*>(CreatureLib::Library::ItemLibrary::GetItem(name));
|
|
}
|
|
const Item* operator[](const std::string& name) const { return GetItem(name); }
|
|
void LoadItem(const std::string& name, const Item* item) {
|
|
CreatureLib::Library::ItemLibrary::LoadItem(name, item);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // PKMNLIB_ITEMLIBRARY_HPP
|