Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user