Adds some documentation, add .clang-tidy file.
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-09-26 12:46:48 +02:00
parent 94d1d68832
commit 15deae1504
5 changed files with 37 additions and 16 deletions

View File

@@ -2,15 +2,25 @@
#define CREATURELIB_TALENTINDEX_HPP
namespace CreatureLib::Library {
/// @brief Stores the index of a talent on a creature. Defines whether or not the talent is secret, and what it's
/// index is.
class TalentIndex {
bool _secret;
uint8_t _index;
public:
inline TalentIndex() noexcept : _secret(false), _index(0){};
inline TalentIndex() noexcept : _index(0){};
/// @brief Initialises a Talent Index from whether or not this is a secret talent, and it's index.
/// @param secret Whether or not this is a secret talent.
/// @param index The index of the talent on the species variant.
inline TalentIndex(bool secret, uint8_t index) noexcept : _secret(secret), _index(index) {}
constexpr inline bool IsSecret() const noexcept { return _secret; }
constexpr inline bool GetIndex() const noexcept { return _index; }
/// @brief Returns whether or not this is a secret talent.
/// @return Whether or not this is a secret talent.
[[nodiscard]] constexpr inline bool IsSecret() const noexcept { return _secret; }
/// @brief Returns the index of the talent on the species variant.
/// @return The index of the talent on the species variant.
[[nodiscard]] constexpr inline uint8_t GetIndex() const noexcept { return _index; }
private:
bool _secret = false;
uint8_t _index;
};
}