Added lots of security using asserts.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef CREATURELIB_LEARNABLEATTACKS_HPP
|
||||
#define CREATURELIB_LEARNABLEATTACKS_HPP
|
||||
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "../Attacks/AttackData.hpp"
|
||||
@@ -11,7 +12,12 @@ namespace CreatureLib::Library {
|
||||
|
||||
public:
|
||||
LearnableAttacks(size_t levelAttackCapacity)
|
||||
: _learnedByLevel(std::unordered_map<uint8_t, std::vector<const AttackData*>>(levelAttackCapacity)) {}
|
||||
: _learnedByLevel(std::unordered_map<uint8_t, std::vector<const AttackData*>>(levelAttackCapacity)) {
|
||||
for (auto kv : _learnedByLevel) {
|
||||
for (auto attack : kv.second)
|
||||
AssertNotNull(attack)
|
||||
}
|
||||
}
|
||||
|
||||
void AddLevelMove(uint8_t level, const AttackData* attack);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user