Initial commit
This commit is contained in:
27
src/Library/AttackLibrary.hpp
Normal file
27
src/Library/AttackLibrary.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef CREATURELIB_ATTACKLIBRARY_HPP
|
||||
#define CREATURELIB_ATTACKLIBRARY_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "Attacks/AttackData.hpp"
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
class AttackLibrary {
|
||||
private:
|
||||
std::unordered_map<std::string, const AttackData*> _attacks;
|
||||
public:
|
||||
AttackLibrary() = default;
|
||||
|
||||
~AttackLibrary(){
|
||||
_attacks.clear();
|
||||
}
|
||||
|
||||
[[nodiscard]] const AttackData* GetAttack(const std::string& name) const;
|
||||
[[nodiscard]] const AttackData* operator[] (const std::string& name) const;
|
||||
|
||||
void LoadAttack(const std::string& name, const AttackData* attack);
|
||||
void DeleteAttack(const std::string& name);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ATTACKLIBRARY_HPP
|
||||
Reference in New Issue
Block a user