28 lines
984 B
C++
28 lines
984 B
C++
#ifndef PKMNLIB_SPECIESLIBRARY_HPP
|
|
#define PKMNLIB_SPECIESLIBRARY_HPP
|
|
|
|
#include <CreatureLib/Library/SpeciesLibrary.hpp>
|
|
#include "PokemonSpecies.hpp"
|
|
|
|
namespace PkmnLib::Library {
|
|
class SpeciesLibrary : public CreatureLib::Library::SpeciesLibrary {
|
|
public:
|
|
inline bool TryGet(const char* name, const PokemonSpecies*& outSpecies) const {
|
|
return CreatureLib::Library::SpeciesLibrary::TryGet(
|
|
name, (const CreatureLib::Library::CreatureSpecies*&)outSpecies);
|
|
}
|
|
|
|
inline const PokemonSpecies* Get(const char* name) const {
|
|
return dynamic_cast<const PokemonSpecies*>(CreatureLib::Library::SpeciesLibrary::Get(name));
|
|
}
|
|
|
|
const PokemonSpecies* operator[](const char* name) const { return Get(name); }
|
|
|
|
void Insert(const char* name, const PokemonSpecies* species) {
|
|
CreatureLib::Library::SpeciesLibrary::Insert(name, species);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // PKMNLIB_SPECIESLIBRARY_HPP
|