Ensure AddLevelAttack adds to distinctMoves
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
680f949df8
commit
a580649224
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
void LearnableAttacks::AddLevelMove(uint8_t level, const AttackData* attack) {
|
void LearnableAttacks::AddLevelAttack(uint8_t level, const AttackData* attack) {
|
||||||
|
|
||||||
List<const AttackData*> levelData;
|
List<const AttackData*> levelData;
|
||||||
if (_learnedByLevel.TryGet(level, levelData)) {
|
if (_learnedByLevel.TryGet(level, levelData)) {
|
||||||
|
@ -11,6 +11,7 @@ void LearnableAttacks::AddLevelMove(uint8_t level, const AttackData* attack) {
|
||||||
levelData = {attack};
|
levelData = {attack};
|
||||||
_learnedByLevel.Insert(level, levelData);
|
_learnedByLevel.Insert(level, levelData);
|
||||||
}
|
}
|
||||||
|
_distinctAttacks.insert(attack);
|
||||||
}
|
}
|
||||||
|
|
||||||
const List<const AttackData*>& LearnableAttacks::GetAttacksForLevel(uint8_t level) const {
|
const List<const AttackData*>& LearnableAttacks::GetAttacksForLevel(uint8_t level) const {
|
||||||
|
|
|
@ -12,6 +12,7 @@ using namespace Arbutils::Collections;
|
||||||
|
|
||||||
namespace CreatureLib::Library {
|
namespace CreatureLib::Library {
|
||||||
class LearnableAttacks {
|
class LearnableAttacks {
|
||||||
|
protected:
|
||||||
Dictionary<uint8_t, List<const AttackData*>> _learnedByLevel;
|
Dictionary<uint8_t, List<const AttackData*>> _learnedByLevel;
|
||||||
std::unordered_set<const AttackData*> _distinctAttacks;
|
std::unordered_set<const AttackData*> _distinctAttacks;
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ namespace CreatureLib::Library {
|
||||||
|
|
||||||
virtual ~LearnableAttacks() = default;
|
virtual ~LearnableAttacks() = default;
|
||||||
|
|
||||||
void AddLevelMove(uint8_t level, const AttackData* attack);
|
void AddLevelAttack(uint8_t level, const AttackData* attack);
|
||||||
|
|
||||||
const List<const AttackData*>& GetAttacksForLevel(uint8_t level) const;
|
const List<const AttackData*>& GetAttacksForLevel(uint8_t level) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue