Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,11 +4,7 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
enum class AttackCategory : uint8_t {
|
||||
Physical,
|
||||
Magical,
|
||||
Status
|
||||
};
|
||||
enum class AttackCategory : uint8_t { Physical, Magical, Status };
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ATTACKCATEGORY_HPP
|
||||
#endif // CREATURELIB_ATTACKCATEGORY_HPP
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "AttackData.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
CreatureLib::Library::AttackData::AttackData(std::string name, std::string type,
|
||||
@@ -7,19 +6,9 @@ CreatureLib::Library::AttackData::AttackData(std::string name, std::string type,
|
||||
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))
|
||||
{}
|
||||
: __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{
|
||||
bool CreatureLib::Library::AttackData::HasFlag(const std::string& key) const {
|
||||
return this->_flags.find(key) != this->_flags.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,23 +3,24 @@
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "../../GenericTemplates.cpp"
|
||||
#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(AttackCategory, Category);
|
||||
GetProperty(uint8_t, BasePower);
|
||||
GetProperty(uint8_t, Accuracy);
|
||||
GetProperty(uint8_t, BaseUsages);
|
||||
GetProperty(AttackTarget, Target);
|
||||
GetProperty(uint8_t , Priority);
|
||||
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);
|
||||
@@ -28,5 +29,4 @@ namespace CreatureLib::Library {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_ATTACKDATA_HPP
|
||||
#endif // CREATURELIB_ATTACKDATA_HPP
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
enum class AttackTarget : uint8_t{
|
||||
enum class AttackTarget : uint8_t {
|
||||
Adjacent,
|
||||
AdjacentAlly,
|
||||
AdjacentAllySelf,
|
||||
@@ -23,4 +23,4 @@ namespace CreatureLib::Library {
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ATTACKTARGET_HPP
|
||||
#endif // CREATURELIB_ATTACKTARGET_HPP
|
||||
|
||||
Reference in New Issue
Block a user