45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
#ifndef CREATURELIB_ATTACKDATA_HPP
|
|
#define CREATURELIB_ATTACKDATA_HPP
|
|
|
|
#include <Arbutils/ConstString.hpp>
|
|
#include <string>
|
|
#include <unordered_set>
|
|
#include "AttackCategory.hpp"
|
|
#include "AttackTarget.hpp"
|
|
|
|
using ConstString = Arbutils::CaseInsensitiveConstString;
|
|
|
|
namespace CreatureLib::Library {
|
|
class AttackData {
|
|
protected:
|
|
const ConstString _name;
|
|
uint8_t _type;
|
|
AttackCategory _category;
|
|
uint8_t _basePower;
|
|
uint8_t _accuracy;
|
|
uint8_t _baseUsages;
|
|
AttackTarget _target;
|
|
int8_t _priority;
|
|
std::unordered_set<uint32_t> _flags;
|
|
|
|
public:
|
|
AttackData(const ConstString& name, uint8_t type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
|
uint8_t baseUsage, AttackTarget target, int8_t priority, std::unordered_set<uint32_t> flags);
|
|
virtual ~AttackData() = default;
|
|
|
|
inline const ConstString& GetName() const { return _name; }
|
|
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; }
|
|
inline uint8_t GetBaseUsages() const { return _baseUsages; }
|
|
inline AttackTarget GetTarget() const { return _target; }
|
|
inline int8_t GetPriority() const { return _priority; }
|
|
|
|
bool HasFlag(const ConstString& key) const;
|
|
bool HasFlag(uint32_t keyHash) const;
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_ATTACKDATA_HPP
|