Change AttackData type to byte instead of string.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
e3bbc369fc
commit
d66bcee979
|
@ -1,12 +1,12 @@
|
|||
#include "AttackData.hpp"
|
||||
#include <utility>
|
||||
|
||||
CreatureLib::Library::AttackData::AttackData(std::string name, std::string type,
|
||||
CreatureLib::Library::AttackData::AttackData(std::string name, uint8_t type,
|
||||
CreatureLib::Library::AttackCategory category, uint8_t power,
|
||||
uint8_t accuracy, uint8_t baseUsage,
|
||||
CreatureLib::Library::AttackTarget target, uint8_t priority,
|
||||
std::unordered_set<std::string> flags)
|
||||
: _name(std::move(name)), _type(std::move(type)), _category(category), _basePower(power), _accuracy(accuracy),
|
||||
: _name(std::move(name)), _type(type), _category(category), _basePower(power), _accuracy(accuracy),
|
||||
_baseUsages(baseUsage), _target(target), _priority(priority), _flags(std::move(flags)) {}
|
||||
|
||||
bool CreatureLib::Library::AttackData::HasFlag(const std::string& key) const {
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace CreatureLib::Library {
|
|||
class AttackData {
|
||||
protected:
|
||||
const std::string _name;
|
||||
const std::string _type;
|
||||
uint8_t _type;
|
||||
AttackCategory _category;
|
||||
uint8_t _basePower;
|
||||
uint8_t _accuracy;
|
||||
|
@ -20,11 +20,11 @@ namespace CreatureLib::Library {
|
|||
std::unordered_set<std::string> _flags;
|
||||
|
||||
public:
|
||||
AttackData(std::string name, std::string type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
||||
AttackData(std::string name, uint8_t type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, AttackTarget target, uint8_t priority, std::unordered_set<std::string> flags);
|
||||
|
||||
inline const std::string& GetName() const { return _name; }
|
||||
inline const std::string& GetType() const { return _type; }
|
||||
inline const uint8_t GetType() const { return _type; }
|
||||
inline AttackCategory GetCategory() const { return _category; }
|
||||
inline uint8_t GetBasePower() const { return _basePower; }
|
||||
inline uint8_t GetAccuracy() const { return _accuracy; }
|
||||
|
|
|
@ -33,13 +33,13 @@ SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
|
|||
|
||||
AttackLibrary* TestLibrary::BuildAttackLibrary() {
|
||||
auto l = new AttackLibrary();
|
||||
l->LoadAttack("standard", new AttackData("standard", "normal", AttackCategory::Physical, 20, 100, 30,
|
||||
l->LoadAttack("standard", new AttackData("standard", 0, AttackCategory::Physical, 20, 100, 30,
|
||||
AttackTarget::AdjacentOpponent, 0, {}));
|
||||
l->LoadAttack("highPriority", new AttackData("highPriority", "normal", AttackCategory::Physical, 20, 100, 30,
|
||||
l->LoadAttack("highPriority", new AttackData("highPriority", 0, AttackCategory::Physical, 20, 100, 30,
|
||||
AttackTarget::AdjacentOpponent, 1, {}));
|
||||
l->LoadAttack("higherPriority", new AttackData("higherPriority", "normal", AttackCategory::Physical, 20, 100, 30,
|
||||
l->LoadAttack("higherPriority", new AttackData("higherPriority", 0, AttackCategory::Physical, 20, 100, 30,
|
||||
AttackTarget::AdjacentOpponent, 2, {}));
|
||||
l->LoadAttack("lowPriority", new AttackData("lowPriority", "normal", AttackCategory::Physical, 20, 100, 30,
|
||||
l->LoadAttack("lowPriority", new AttackData("lowPriority", 0, AttackCategory::Physical, 20, 100, 30,
|
||||
AttackTarget::AdjacentOpponent, -1, {}));
|
||||
return l;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue