Replace most collections with Arbutils collections for more safety.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-22 19:21:40 +01:00
parent f190121e74
commit 27288563cd
40 changed files with 234 additions and 226 deletions

View File

@@ -3,14 +3,16 @@
using namespace CreatureLib::Library;
void LearnableAttacks::AddLevelMove(uint8_t level, const AttackData* attack) {
auto find = _learnedByLevel.find(level);
if (find != _learnedByLevel.end()) {
find->second.push_back(attack);
List<const AttackData*> levelData;
if (_learnedByLevel.TryGet(level, levelData)) {
levelData.Append(attack);
} else {
_learnedByLevel.insert({level, {attack}});
levelData = {attack};
_learnedByLevel.Insert(level, levelData);
}
}
const std::vector<const AttackData*>& LearnableAttacks::GetAttacksForLevel(uint8_t level) const {
return _learnedByLevel.at(level);
const List<const AttackData*>& LearnableAttacks::GetAttacksForLevel(uint8_t level) const {
return _learnedByLevel.Get(level);
}