Initial commit

This commit is contained in:
2019-10-06 13:50:52 +02:00
commit 265923231f
44 changed files with 16258 additions and 0 deletions

View 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

View 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();
}

View 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

View 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