28 lines
1.2 KiB
C++
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, u8 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 u8 GetIndex() const noexcept { return _index; }
|
|
|
|
private:
|
|
bool _secret = false;
|
|
u8 _index;
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_TALENTINDEX_HPP
|