Update to newer Arbutils version.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-26 18:31:06 +02:00
parent d746b3ecce
commit 25f65eb47b
68 changed files with 334 additions and 354 deletions

View File

@@ -8,17 +8,15 @@
#include <unordered_map>
#include "../Attacks/AttackData.hpp"
using namespace Arbutils::Collections;
namespace CreatureLib::Library {
class LearnableAttacks {
protected:
Dictionary<uint8_t, List<const AttackData*>> _learnedByLevel;
ArbUt::Dictionary<uint8_t, ArbUt::List<const AttackData*>> _learnedByLevel;
std::unordered_set<const AttackData*> _distinctAttacks;
public:
explicit LearnableAttacks(size_t levelAttackCapacity)
: _learnedByLevel(Dictionary<uint8_t, List<const AttackData*>>(levelAttackCapacity)) {
: _learnedByLevel(ArbUt::Dictionary<uint8_t, ArbUt::List<const AttackData*>>(levelAttackCapacity)) {
for (auto kv : _learnedByLevel) {
for (auto attack : kv.second) {
AssertNotNull(attack)
@@ -31,9 +29,9 @@ namespace CreatureLib::Library {
void AddLevelAttack(uint8_t level, const AttackData* attack);
const List<const AttackData*>& GetAttacksForLevel(uint8_t level) const;
const ArbUt::List<const AttackData*>& GetAttacksForLevel(uint8_t level) const;
virtual const AttackData* GetRandomAttack(Arbutils::Random& rand) const {
virtual const AttackData* GetRandomAttack(ArbUt::Random& rand) const {
if (_distinctAttacks.empty()) {
return nullptr;
}