Initial commit
This commit is contained in:
28
src/Library/SpeciesLibrary.hpp
Normal file
28
src/Library/SpeciesLibrary.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef CREATURELIB_SPECIESLIBRARY_HPP
|
||||
#define CREATURELIB_SPECIESLIBRARY_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "CreatureData/CreatureSpecies.hpp"
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
class SpeciesLibrary {
|
||||
private:
|
||||
std::unordered_map<std::string, const CreatureSpecies*> _species;
|
||||
public:
|
||||
SpeciesLibrary() = default;
|
||||
|
||||
~SpeciesLibrary(){
|
||||
_species.clear();
|
||||
}
|
||||
|
||||
[[nodiscard]] const CreatureSpecies* GetSpecies(const std::string& name) const;
|
||||
[[nodiscard]] const CreatureSpecies* operator[] (const std::string& name) const;
|
||||
|
||||
void LoadSpecies(const std::string& name, const CreatureSpecies* species);
|
||||
void DeleteSpecies(const std::string& name);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_SPECIESLIBRARY_HPP
|
||||
Reference in New Issue
Block a user