Add easy to use macro to generate enum helper functions for parsing, stringifying and iteration.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-12 19:48:56 +01:00
parent a8944e2026
commit 2732a904c4
8 changed files with 170 additions and 48 deletions

View File

@@ -2,9 +2,10 @@
#define CREATURELIB_ATTACKCATEGORY_HPP
#include <cstdint>
#include "../../Core/Enum.hpp"
namespace CreatureLib::Library {
enum class AttackCategory : uint8_t { Physical, Magical, Status };
ENUM(AttackCategory, uint8_t, Physical, Magical, Status)
}
#endif // CREATURELIB_ATTACKCATEGORY_HPP

View File

@@ -2,25 +2,16 @@
#define CREATURELIB_ATTACKTARGET_HPP
#include <cstdint>
#include "../../Core/Enum.hpp"
namespace CreatureLib::Library {
enum class AttackTarget : uint8_t {
Adjacent,
AdjacentAlly,
AdjacentAllySelf,
AdjacentOpponent,
ENUM(AttackTarget, uint8_t, Adjacent, AdjacentAlly, AdjacentAllySelf, AdjacentOpponent,
All,
AllAdjacent,
AllAdjacentOpponent,
AllAlly,
AllOpponent,
All, AllAdjacent, AllAdjacentOpponent, AllAlly, AllOpponent,
Any,
Any,
RandomOpponent,
Self,
};
RandomOpponent, Self)
}
#endif // CREATURELIB_ATTACKTARGET_HPP

View File

@@ -2,13 +2,14 @@
#define CREATURELIB_GENDER_HPP
#include <cstdint>
#include "../Core/Enum.hpp"
namespace CreatureLib::Library {
/*!
\brief Might be somewhat controversial nowadays, but as many creature battling games only have two genders, we'll
hardcode those.
*/
enum class Gender : uint8_t { Male, Female, Genderless };
ENUM(Gender, uint8_t, Male, Female, Genderless)
}
#endif // CREATURELIB_GENDER_HPP