Files
CreatureLib/src/Library/CreatureData/TalentIndex.hpp
Deukhoofd 15deae1504
Some checks failed
continuous-integration/drone/push Build is failing
Adds some documentation, add .clang-tidy file.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-26 12:46:48 +02:00

28 lines
1.2 KiB
C++

#ifndef CREATURELIB_TALENTINDEX_HPP
#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 {
public:
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) {}
/// @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;
};
}
#endif // CREATURELIB_TALENTINDEX_HPP