Replace most collections with Arbutils collections for more safety.
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user