Cleanup CMake file.
This commit is contained in:
parent
5032377554
commit
367ed7fcbb
|
@ -79,9 +79,7 @@ export bool CreatureLib_Creature_HasVolatileScript(Creature* p, const char* scri
|
|||
return p->HasVolatileScript(ArbUt::StringView(scriptName));
|
||||
}
|
||||
export size_t CreatureLib_Creature_GetAttacksCount(Creature* p) { return p->GetAttacks().Count(); }
|
||||
export LearnedAttack* const* CreatureLib_Creature_GetAttack(Creature* p, size_t index) {
|
||||
return p->GetAttacks().RawData();
|
||||
}
|
||||
export LearnedAttack* const* CreatureLib_Creature_GetAttacks(Creature* p) { return p->GetAttacks().RawData(); }
|
||||
BORROWED_GET_FUNC(Creature, GetDisplaySpecies, const CreatureLib::Library::CreatureSpecies*);
|
||||
BORROWED_GET_FUNC(Creature, GetDisplayVariant, const CreatureLib::Library::SpeciesVariant*);
|
||||
export void CreatureLib_Creature_SetDisplaySpecies(Creature* p, const CreatureLib::Library::CreatureSpecies* species) {
|
||||
|
|
|
@ -44,7 +44,7 @@ export uint8_t CreatureLib_CreatureSpecies_GetVariant(const SpeciesVariant*& out
|
|||
const char* name) {
|
||||
Try(out = p->GetVariant(ArbUt::StringView::CalculateHash(name)).GetRaw();)
|
||||
}
|
||||
export uint8_t CreatureLib_CreatureSpecies_GetVariantWithHash(const SpeciesVariant* out, const CreatureSpecies* p,
|
||||
export uint8_t CreatureLib_CreatureSpecies_GetVariantWithHash(const SpeciesVariant*& out, const CreatureSpecies* p,
|
||||
uint32_t hash) {
|
||||
Try(out = p->GetVariant(hash).GetRaw();)
|
||||
}
|
||||
|
|
|
@ -1,40 +1,24 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Make warnings trigger errors.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
||||
|
||||
project(CreatureLib)
|
||||
|
||||
# Enable all warnings, and make them error when occurring.
|
||||
add_compile_options(-Wall -Wextra -Werror)
|
||||
# We like new stuff, so set the c++ standard to c++20.
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.")
|
||||
string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}")
|
||||
list(GET VERSION_LIST 0 VERSION)
|
||||
list(GET VERSION_LIST 1 MINOR)
|
||||
if (NOT MINOR MATCHES 0)
|
||||
SET(VERSION ${VERSION}.${MINOR})
|
||||
endif ()
|
||||
set(CONAN_STATIC_C False)
|
||||
if (STATICC)
|
||||
set(CONAN_STATIC_C True)
|
||||
endif (STATICC)
|
||||
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
||||
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
||||
option(TESTS "Whether the test executable should be build as well." OFF)
|
||||
option(STATICC "Whether gcc and stdc++ should be linked statically to the library." OFF)
|
||||
|
||||
if (NOT WINDOWS)
|
||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||
else ()
|
||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||
endif ()
|
||||
endif ()
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
include(CmakeConanSetup.cmake)
|
||||
SetupConan()
|
||||
|
||||
if (WINDOWS)
|
||||
ADD_DEFINITIONS(-D WINDOWS=1)
|
||||
endif (WINDOWS)
|
||||
# Set whether we want a static or shared library.
|
||||
set(LIBTYPE STATIC)
|
||||
if (SHARED)
|
||||
set(LIBTYPE SHARED)
|
||||
endif (SHARED)
|
||||
|
||||
# Create main Library library with files in src/Library
|
||||
file(GLOB_RECURSE LIBRARY_SRC_FILES "src/Library/*.cpp" "src/Library/*.hpp" "CInterface/Library/*.cpp" "CInterface/Core.*")
|
||||
|
@ -44,34 +28,36 @@ add_library(CreatureLibLibrary SHARED ${LIBRARY_SRC_FILES})
|
|||
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp" "CInterface/Battling/*.cpp" "CInterface/Core.*")
|
||||
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
||||
|
||||
SET(_LIBRARYLINKS Arbutils)
|
||||
SET(_BATTLINGLINKS CreatureLibLibrary Arbutils)
|
||||
SET(_TESTLINKS CreatureLibLibrary CreatureLibBattling Arbutils)
|
||||
|
||||
# If we are building for Windows we need to set some specific variables.
|
||||
if (WINDOWS)
|
||||
message(STATUS "Using Windows build.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L ${CMAKE_BINARY_DIR}/bin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition")
|
||||
MESSAGE(WARNING, "Using Windows Build.")
|
||||
# Add a definition for the compiler, so we can use it in C++ as well.
|
||||
ADD_DEFINITIONS(-D WINDOWS=1)
|
||||
# -m64: Build a 64 bit library
|
||||
add_compile_options(-m64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-allow-multiple-definition")
|
||||
endif (WINDOWS)
|
||||
|
||||
# Set up links to all relevant libraries.
|
||||
SET(_LIBRARYLINKS Arbutils)
|
||||
SET(_BATTLINGLINKS CreatureLibLibrary Arbutils)
|
||||
|
||||
# If we need to link the C libraries statically, do so.
|
||||
if (STATICC)
|
||||
message(STATUS "Linking C statically.")
|
||||
SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++)
|
||||
SET(_BATTLINGLINKS ${_BATTLINGLINKS} -static-libgcc -static-libstdc++)
|
||||
if (NOT DEFINED CONAN_EXPORTED)
|
||||
SET(_TESTLINKS ${_TESTLINKS} -static-libgcc -static-libstdc++)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# And link the libraries together
|
||||
target_link_libraries(CreatureLibLibrary PUBLIC ${_LIBRARYLINKS})
|
||||
target_link_libraries(CreatureLibBattling PUBLIC ${_BATTLINGLINKS})
|
||||
|
||||
if (NOT DEFINED CONAN_EXPORTED)
|
||||
if (TESTS)
|
||||
# Create Test executable
|
||||
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
||||
add_executable(CreatureLibTests ${TEST_FILES} extern/catch.hpp)
|
||||
message(STATUS "${_TESTLINKS}")
|
||||
target_link_libraries(CreatureLibTests PUBLIC ${_TESTLINKS})
|
||||
target_link_libraries(CreatureLibTests PUBLIC CreatureLibLibrary CreatureLibBattling Arbutils)
|
||||
|
||||
# Add a definition for the test library
|
||||
target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
function(SetupConan)
|
||||
# If conan isn't set up yet, we need to install the dependencies.
|
||||
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.")
|
||||
|
||||
# If we're linking C statically, we also want to do so for our dependencies.
|
||||
set(CONAN_STATIC_C False)
|
||||
if (STATICC)
|
||||
set(CONAN_STATIC_C True)
|
||||
endif (STATICC)
|
||||
|
||||
if (NOT WINDOWS)
|
||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||
-s compiler=clang -s compiler.libcxx=libstdc++11 -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||
else ()
|
||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s os=Windows -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||
endif ()
|
||||
endif ()
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
endfunction()
|
|
@ -33,8 +33,8 @@ class CreatureLibConan(ConanFile):
|
|||
|
||||
def imports(self):
|
||||
if self.settings.os == "Windows":
|
||||
self.copy("*.dll", "bin", "bin")
|
||||
self.copy("*.a", "bin", "bin")
|
||||
self.copy("*.dll", "", "bin")
|
||||
self.copy("*.a", "", "bin")
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["CreatureLibCore", "CreatureLibLibrary", "CreatureLibBattling"]
|
||||
|
|
|
@ -29,7 +29,8 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void TurnOrdering::OrderChoices(std::vector<std::shared_ptr<BaseTurnChoice>>& vec, ArbUt::Random& rand) {
|
||||
void TurnOrdering::OrderChoices(std::vector<std::shared_ptr<BaseTurnChoice>>& vec,
|
||||
[[maybe_unused]] ArbUt::Random& rand) {
|
||||
for (auto item : vec) {
|
||||
if (item->GetKind() == TurnChoiceKind::Attack) {
|
||||
auto attackChoice = static_cast<AttackTurnChoice*>(item.get());
|
||||
|
|
|
@ -18,7 +18,7 @@ uint32_t DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uin
|
|||
}
|
||||
|
||||
uint8_t DamageLibrary::GetBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
||||
const ExecutingAttack::HitData& hitData) const {
|
||||
[[maybe_unused]] const ExecutingAttack::HitData& hitData) const {
|
||||
AssertNotNull(attack)
|
||||
AssertNotNull(target)
|
||||
auto bp = attack->GetAttack()->GetAttack()->GetBasePower();
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "../Models/Battle.hpp"
|
||||
#include "../TurnChoices/AttackTurnChoice.hpp"
|
||||
|
||||
bool CreatureLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::ExecutingAttack* attack,
|
||||
CreatureLib::Battling::Creature* target, uint8_t hit) const {
|
||||
bool CreatureLib::Battling::MiscLibrary::IsCritical([[maybe_unused]] CreatureLib::Battling::ExecutingAttack* attack,
|
||||
CreatureLib::Battling::Creature* target,
|
||||
[[maybe_unused]] uint8_t hit) const {
|
||||
AssertNotNull(target)
|
||||
auto rand = target->GetBattle()->GetRandom();
|
||||
return rand->Get(10) <= 0;
|
||||
|
@ -31,9 +32,9 @@ static CreatureLib::Battling::LearnedAttack* GetReplacementAttack() {
|
|||
return _replacementAttack;
|
||||
}
|
||||
|
||||
bool CreatureLib::Battling::MiscLibrary::CanFlee(FleeTurnChoice* switchChoice) const { return true; }
|
||||
bool CreatureLib::Battling::MiscLibrary::CanFlee([[maybe_unused]] FleeTurnChoice* switchChoice) const { return true; }
|
||||
CreatureLib::Battling::BaseTurnChoice*
|
||||
CreatureLib::Battling::MiscLibrary::ReplacementAttack(Creature* user, CreatureIndex target) const {
|
||||
CreatureLib::Battling::MiscLibrary::ReplacementAttack(Creature* user, [[maybe_unused]] CreatureIndex target) const {
|
||||
AssertNotNull(user)
|
||||
auto sideTarget = 0;
|
||||
if (user->GetBattleSide()->GetSideIndex() == 0)
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace CreatureLib::Battling {
|
|||
return false;
|
||||
}
|
||||
|
||||
inline const uint8_t GetTargetCount() const noexcept { return _targetCount; }
|
||||
inline uint8_t GetTargetCount() const noexcept { return _targetCount; }
|
||||
inline const ArbUt::BorrowedPtr<Creature>* GetTargets() const noexcept { return _targets; }
|
||||
inline uint8_t GetNumberOfHits() const noexcept { return _numberHits; }
|
||||
|
||||
|
|
|
@ -21,45 +21,59 @@ namespace CreatureLib::Battling {
|
|||
|
||||
virtual const ArbUt::StringView& GetName() const noexcept = 0;
|
||||
|
||||
virtual void OnInitialize(const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
|
||||
virtual void OnBeforeTurn(const BaseTurnChoice* choice){};
|
||||
virtual void
|
||||
OnInitialize([[maybe_unused]] const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
|
||||
virtual void OnBeforeTurn([[maybe_unused]] const BaseTurnChoice* choice){};
|
||||
|
||||
virtual void ChangePriority(AttackTurnChoice* choice, int8_t* priority){};
|
||||
virtual void ChangeAttack(AttackTurnChoice* choice, ArbUt::StringView* outAttack){};
|
||||
virtual void PreventAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
virtual void FailAttack(ExecutingAttack* attack, bool* outFailed){};
|
||||
virtual void StopBeforeAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
virtual void OnBeforeAttack(ExecutingAttack* attack){};
|
||||
virtual void ChangePriority([[maybe_unused]] AttackTurnChoice* choice, [[maybe_unused]] int8_t* priority){};
|
||||
virtual void ChangeAttack([[maybe_unused]] AttackTurnChoice* choice,
|
||||
[[maybe_unused]] ArbUt::StringView* outAttack){};
|
||||
virtual void PreventAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outResult){};
|
||||
virtual void FailAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outFailed){};
|
||||
virtual void StopBeforeAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outResult){};
|
||||
virtual void OnBeforeAttack([[maybe_unused]] ExecutingAttack* attack){};
|
||||
|
||||
virtual void FailIncomingAttack(ExecutingAttack* attack, Creature* target, bool* outResult){};
|
||||
virtual void IsInvulnerable(ExecutingAttack* attack, Creature* target, bool* outResult){};
|
||||
virtual void OnAttackMiss(ExecutingAttack* attack, Creature* target){};
|
||||
virtual void ChangeAttackType(ExecutingAttack* attack, Creature* target, uint8_t hitNumber, uint8_t* outType){};
|
||||
virtual void ChangeEffectiveness(ExecutingAttack* attack, Creature* target, uint8_t hitNumber,
|
||||
float* effectiveness){};
|
||||
virtual void FailIncomingAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] bool* outResult){};
|
||||
virtual void IsInvulnerable([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] bool* outResult){};
|
||||
virtual void OnAttackMiss([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target){};
|
||||
virtual void ChangeAttackType([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitNumber, [[maybe_unused]] uint8_t* outType){};
|
||||
virtual void ChangeEffectiveness([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitNumber, [[maybe_unused]] float* effectiveness){};
|
||||
|
||||
virtual void OverrideBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
||||
uint8_t* basePower){};
|
||||
virtual void ChangeDamageStatsUser(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
||||
Creature** statsUser){};
|
||||
virtual void OverrideBasePower([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] uint8_t* basePower){};
|
||||
virtual void ChangeDamageStatsUser([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] Creature** statsUser){};
|
||||
|
||||
virtual void BypassDefensiveStat(ExecutingAttack* attack, Creature* target, uint8_t hitIndex, bool* bypass){};
|
||||
virtual void BypassOffensiveStat(ExecutingAttack* attack, Creature* target, uint8_t hitIndex, bool* bypass){};
|
||||
virtual void ModifyStatModifier(ExecutingAttack* attack, Creature* target, uint8_t hitIndex, float* modifier){};
|
||||
virtual void ModifyDamageModifier(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
||||
float* modifier){};
|
||||
virtual void OverrideDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex, uint32_t* damage){};
|
||||
virtual void BypassDefensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] bool* bypass){};
|
||||
virtual void BypassOffensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] bool* bypass){};
|
||||
virtual void ModifyStatModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] float* modifier){};
|
||||
virtual void ModifyDamageModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] float* modifier){};
|
||||
virtual void OverrideDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
|
||||
[[maybe_unused]] uint8_t hitIndex, [[maybe_unused]] uint32_t* damage){};
|
||||
|
||||
virtual void PreventSecondaryEffects(const ExecutingAttack* attack, Creature* target, uint8_t hitNumber,
|
||||
bool* outResult){};
|
||||
virtual void OnSecondaryEffect(const ExecutingAttack* attack, Creature* target, uint8_t hitNumber){};
|
||||
virtual void PreventSecondaryEffects([[maybe_unused]] const ExecutingAttack* attack,
|
||||
[[maybe_unused]] Creature* target, [[maybe_unused]] uint8_t hitNumber,
|
||||
[[maybe_unused]] bool* outResult){};
|
||||
virtual void OnSecondaryEffect([[maybe_unused]] const ExecutingAttack* attack,
|
||||
[[maybe_unused]] Creature* target, [[maybe_unused]] uint8_t hitNumber){};
|
||||
|
||||
virtual void OnAfterHits(const ExecutingAttack* attack, Creature* target){};
|
||||
virtual void OnAfterHits([[maybe_unused]] const ExecutingAttack* attack, [[maybe_unused]] Creature* target){};
|
||||
|
||||
virtual void PreventSelfSwitch(const SwitchTurnChoice* choice, bool* outResult){};
|
||||
virtual void PreventSelfSwitch([[maybe_unused]] const SwitchTurnChoice* choice,
|
||||
[[maybe_unused]] bool* outResult){};
|
||||
|
||||
virtual void ModifyEffectChance(const ExecutingAttack* attack, Creature* target, float* chance){};
|
||||
virtual void ModifyIncomingEffectChance(const ExecutingAttack* attack, Creature* target, float* chance){};
|
||||
virtual void ModifyEffectChance([[maybe_unused]] const ExecutingAttack* attack,
|
||||
[[maybe_unused]] Creature* target, [[maybe_unused]] float* chance){};
|
||||
virtual void ModifyIncomingEffectChance([[maybe_unused]] const ExecutingAttack* attack,
|
||||
[[maybe_unused]] Creature* target, [[maybe_unused]] float* chance){};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,11 @@ namespace CreatureLib::Battling {
|
|||
public:
|
||||
virtual ~ScriptResolver() = default;
|
||||
|
||||
virtual void Initialize(BattleLibrary* library){};
|
||||
virtual Script* LoadScript(ScriptCategory category, const ArbUt::StringView& scriptName) { return nullptr; };
|
||||
virtual void Initialize([[maybe_unused]] BattleLibrary* library){};
|
||||
virtual Script* LoadScript([[maybe_unused]] ScriptCategory category,
|
||||
[[maybe_unused]] const ArbUt::StringView& scriptName) {
|
||||
return nullptr;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace CreatureLib::Library {
|
|||
virtual ~AttackData() = default;
|
||||
|
||||
inline const ArbUt::StringView& GetName() const noexcept { return _name; }
|
||||
inline const uint8_t GetType() const noexcept { return _type; }
|
||||
inline uint8_t GetType() const noexcept { return _type; }
|
||||
inline AttackCategory GetCategory() const noexcept { return _category; }
|
||||
inline uint8_t GetBasePower() const noexcept { return _basePower; }
|
||||
inline uint8_t GetAccuracy() const noexcept { return _accuracy; }
|
||||
|
|
|
@ -48,8 +48,8 @@ namespace CreatureLib::Library {
|
|||
[[nodiscard]] inline uint16_t GetStatistic(Library::Statistic stat) const {
|
||||
return _baseStatistics.GetStat(stat);
|
||||
}
|
||||
[[nodiscard]] inline const size_t GetTalentCount() const noexcept { return _talents.Count(); }
|
||||
[[nodiscard]] inline const size_t GetSecretTalentCount() const noexcept { return _secretTalents.Count(); }
|
||||
[[nodiscard]] inline size_t GetTalentCount() const noexcept { return _talents.Count(); }
|
||||
[[nodiscard]] inline size_t GetSecretTalentCount() const noexcept { return _secretTalents.Count(); }
|
||||
[[nodiscard]] const ArbUt::StringView& GetTalent(const TalentIndex& index) const {
|
||||
if (index.IsSecret() && _secretTalents.Count() > 0) {
|
||||
auto i = index.GetIndex();
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace CreatureLib::Library {
|
|||
inline const ArbUt::StringView& GetName() const noexcept { return _name; }
|
||||
inline ItemCategory GetCategory() const noexcept { return _category; }
|
||||
inline BattleItemCategory GetBattleCategory() const noexcept { return _battleCategory; }
|
||||
inline const int32_t GetPrice() const noexcept { return _price; }
|
||||
inline int32_t GetPrice() const noexcept { return _price; }
|
||||
|
||||
bool HasFlag(const ArbUt::BasicStringView& flag) const noexcept { return this->_flags.contains(flag); }
|
||||
bool HasFlag(uint32_t flag) const noexcept { return this->_flags.contains(flag); }
|
||||
|
|
Loading…
Reference in New Issue