57 lines
2.8 KiB
C++
57 lines
2.8 KiB
C++
#include "BattleLibrary.hpp"
|
|
|
|
using namespace CreatureLib::Battling;
|
|
|
|
BattleLibrary::BattleLibrary(const CreatureLib::Library::DataLibrary* non_null staticLib,
|
|
BattleStatCalculator* non_null statCalculator, DamageLibrary* non_null damageLibrary,
|
|
ExperienceLibrary* non_null experienceLibrary, ScriptResolver* non_null scriptResolver,
|
|
MiscLibrary* non_null miscLibrary)
|
|
: _staticLib(staticLib), _statCalculator(statCalculator), _damageLibrary(damageLibrary),
|
|
_experienceLibrary(experienceLibrary), _scriptResolver(scriptResolver), _miscLibrary(miscLibrary) {
|
|
EnsureNotNull(_staticLib);
|
|
EnsureNotNull(_statCalculator);
|
|
EnsureNotNull(_damageLibrary);
|
|
EnsureNotNull(_experienceLibrary);
|
|
EnsureNotNull(_scriptResolver);
|
|
EnsureNotNull(_miscLibrary);
|
|
}
|
|
|
|
const std::unique_ptr<const CreatureLib::Library::LibrarySettings>& BattleLibrary::GetSettings() const noexcept {
|
|
return _staticLib->GetSettings();
|
|
}
|
|
|
|
const std::unique_ptr<const BattleStatCalculator>& BattleLibrary::GetStatCalculator() const noexcept {
|
|
return _statCalculator;
|
|
}
|
|
|
|
const std::unique_ptr<const CreatureLib::Library::SpeciesLibrary>& BattleLibrary::GetSpeciesLibrary() const noexcept {
|
|
return _staticLib->GetSpeciesLibrary();
|
|
}
|
|
|
|
const std::unique_ptr<const CreatureLib::Library::ItemLibrary>& BattleLibrary::GetItemLibrary() const noexcept {
|
|
return _staticLib->GetItemLibrary();
|
|
}
|
|
|
|
const std::unique_ptr<const CreatureLib::Library::AttackLibrary>& BattleLibrary::GetAttackLibrary() const noexcept {
|
|
return _staticLib->GetAttackLibrary();
|
|
}
|
|
|
|
const std::unique_ptr<const CreatureLib::Library::TypeLibrary>& BattleLibrary::GetTypeLibrary() const noexcept {
|
|
return _staticLib->GetTypeLibrary();
|
|
}
|
|
|
|
const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() const noexcept { return _damageLibrary; }
|
|
|
|
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
|
|
|
|
ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
|
ScriptCategory category,
|
|
const ArbUt::StringView& scriptName) const {
|
|
return _scriptResolver->LoadScript(owner, category, scriptName).TakeOwnership();
|
|
}
|
|
ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScriptByHash(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
|
ScriptCategory category,
|
|
u32 scriptNameHash) const {
|
|
return _scriptResolver->LoadScriptByHash(owner, category, scriptNameHash).TakeOwnership();
|
|
}
|