Files
CreatureLib/src/Library/CreatureData/LearnableAttacks.cpp
Deukhoofd 2c4c0f2277
All checks were successful
continuous-integration/drone/push Build is passing
Rework LearnableAttacks to use ArbUt::BorrowedPtr
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-08-11 19:09:58 +02:00

13 lines
421 B
C++

#include "LearnableAttacks.hpp"
using namespace CreatureLib::Library;
void LearnableAttacks::AddLevelAttack(uint8_t level, ArbUt::BorrowedPtr<const AttackData> attack) {
if (_learnedByLevel.Has(level)) {
_learnedByLevel[level].Append(attack);
} else {
_learnedByLevel.Insert(level, {attack});
}
if (!_distinctLevelAttacks.Contains(attack))
_distinctLevelAttacks.Append(attack);
}