Initial commit
This commit is contained in:
14
src/Library/Attacks/AttackCategory.hpp
Normal file
14
src/Library/Attacks/AttackCategory.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef CREATURELIB_ATTACKCATEGORY_HPP
|
||||
#define CREATURELIB_ATTACKCATEGORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
enum class AttackCategory : uint8_t {
|
||||
Physical,
|
||||
Magical,
|
||||
Status
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ATTACKCATEGORY_HPP
|
||||
25
src/Library/Attacks/AttackData.cpp
Normal file
25
src/Library/Attacks/AttackData.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "AttackData.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
CreatureLib::Library::AttackData::AttackData(std::string name, std::string 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),
|
||||
__BaseUsages(baseUsage),
|
||||
__Target(target),
|
||||
__Priority(priority),
|
||||
_flags(std::move(flags))
|
||||
{}
|
||||
|
||||
bool CreatureLib::Library::AttackData::HasFlag(const std::string& key) const{
|
||||
return this->_flags.find(key) != this->_flags.end();
|
||||
}
|
||||
|
||||
32
src/Library/Attacks/AttackData.hpp
Normal file
32
src/Library/Attacks/AttackData.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef CREATURELIB_ATTACKDATA_HPP
|
||||
#define CREATURELIB_ATTACKDATA_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "AttackCategory.hpp"
|
||||
#include "AttackTarget.hpp"
|
||||
|
||||
#include "../../GenericTemplates.cpp"
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
class AttackData {
|
||||
GetProperty(std::string, Name);
|
||||
GetProperty(std::string, Type);
|
||||
GetProperty(AttackCategory , Category);
|
||||
GetProperty(uint8_t , BasePower);
|
||||
GetProperty(uint8_t , Accuracy);
|
||||
GetProperty(uint8_t , BaseUsages);
|
||||
GetProperty(AttackTarget, Target);
|
||||
GetProperty(uint8_t , Priority);
|
||||
private:
|
||||
std::unordered_set<std::string> _flags;
|
||||
public:
|
||||
AttackData(std::string name, std::string type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, AttackTarget target, uint8_t priority, std::unordered_set<std::string> flags);
|
||||
|
||||
bool HasFlag(const std::string& key) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_ATTACKDATA_HPP
|
||||
26
src/Library/Attacks/AttackTarget.hpp
Normal file
26
src/Library/Attacks/AttackTarget.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef CREATURELIB_ATTACKTARGET_HPP
|
||||
#define CREATURELIB_ATTACKTARGET_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
enum class AttackTarget : uint8_t{
|
||||
Adjacent,
|
||||
AdjacentAlly,
|
||||
AdjacentAllySelf,
|
||||
AdjacentOpponent,
|
||||
|
||||
All,
|
||||
AllAdjacent,
|
||||
AllAdjacentOpponent,
|
||||
AllAlly,
|
||||
AllOpponent,
|
||||
|
||||
Any,
|
||||
|
||||
RandomOpponent,
|
||||
Self,
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ATTACKTARGET_HPP
|
||||
Reference in New Issue
Block a user