Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -9,22 +9,23 @@ namespace CreatureLib::Library {
class AttackLibrary {
private:
std::unordered_map<std::string, const AttackData*> _attacks;
public:
AttackLibrary() = default;
~AttackLibrary(){
for (auto attack: _attacks){
~AttackLibrary() {
for (auto attack : _attacks) {
delete attack.second;
}
_attacks.clear();
}
[[nodiscard]] const AttackData* GetAttack(const std::string& name) const;
[[nodiscard]] const AttackData* operator[] (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
#endif // CREATURELIB_ATTACKLIBRARY_HPP