2019-10-17 12:33:25 +00:00
|
|
|
#include "BattleLibrary.hpp"
|
|
|
|
|
2019-11-18 17:41:55 +00:00
|
|
|
using namespace CreatureLib::Battling;
|
|
|
|
|
2020-04-04 11:37:06 +00:00
|
|
|
BattleLibrary::BattleLibrary(const CreatureLib::Library::DataLibrary* staticLib, BattleStatCalculator* statCalculator,
|
|
|
|
DamageLibrary* damageLibrary, ExperienceLibrary* experienceLibrary,
|
|
|
|
ScriptResolver* scriptResolver, MiscLibrary* miscLibrary)
|
|
|
|
: _staticLib(staticLib), _statCalculator(statCalculator), _damageLibrary(damageLibrary),
|
2020-04-04 11:42:06 +00:00
|
|
|
_experienceLibrary(experienceLibrary), _scriptResolver(scriptResolver), _miscLibrary(miscLibrary) {
|
2020-12-13 11:15:40 +00:00
|
|
|
EnsureNotNull(_staticLib);
|
|
|
|
EnsureNotNull(_statCalculator);
|
|
|
|
EnsureNotNull(_damageLibrary);
|
|
|
|
EnsureNotNull(_experienceLibrary);
|
|
|
|
EnsureNotNull(_scriptResolver);
|
|
|
|
EnsureNotNull(_miscLibrary);
|
2020-04-04 11:42:06 +00:00
|
|
|
}
|
2020-04-04 11:37:06 +00:00
|
|
|
|
2020-05-26 13:02:41 +00:00
|
|
|
const std::unique_ptr<const CreatureLib::Library::LibrarySettings>& BattleLibrary::GetSettings() const noexcept {
|
2020-04-04 11:37:06 +00:00
|
|
|
return _staticLib->GetSettings();
|
|
|
|
}
|
|
|
|
|
2020-05-26 13:11:04 +00:00
|
|
|
const std::unique_ptr<const BattleStatCalculator>& BattleLibrary::GetStatCalculator() const noexcept {
|
|
|
|
return _statCalculator;
|
|
|
|
}
|
2020-04-04 11:37:06 +00:00
|
|
|
|
2020-05-26 13:02:41 +00:00
|
|
|
const std::unique_ptr<const CreatureLib::Library::SpeciesLibrary>& BattleLibrary::GetSpeciesLibrary() const noexcept {
|
2020-04-04 11:37:06 +00:00
|
|
|
return _staticLib->GetSpeciesLibrary();
|
|
|
|
}
|
|
|
|
|
2020-05-26 13:02:41 +00:00
|
|
|
const std::unique_ptr<const CreatureLib::Library::ItemLibrary>& BattleLibrary::GetItemLibrary() const noexcept {
|
2020-04-04 11:37:06 +00:00
|
|
|
return _staticLib->GetItemLibrary();
|
|
|
|
}
|
|
|
|
|
2020-05-26 13:02:41 +00:00
|
|
|
const std::unique_ptr<const CreatureLib::Library::AttackLibrary>& BattleLibrary::GetAttackLibrary() const noexcept {
|
2020-04-04 11:37:06 +00:00
|
|
|
return _staticLib->GetAttackLibrary();
|
|
|
|
}
|
|
|
|
|
2020-05-26 13:02:41 +00:00
|
|
|
const std::unique_ptr<const CreatureLib::Library::TypeLibrary>& BattleLibrary::GetTypeLibrary() const noexcept {
|
2020-04-04 11:37:06 +00:00
|
|
|
return _staticLib->GetTypeLibrary();
|
2020-03-25 18:07:36 +00:00
|
|
|
}
|
2019-11-05 13:31:54 +00:00
|
|
|
|
2020-05-26 13:11:04 +00:00
|
|
|
const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() const noexcept { return _damageLibrary; }
|
2019-11-05 13:31:54 +00:00
|
|
|
|
2020-05-26 13:11:04 +00:00
|
|
|
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
|
2019-11-05 16:42:45 +00:00
|
|
|
|
2020-06-26 16:23:40 +00:00
|
|
|
Script* BattleLibrary::LoadScript(ScriptCategory category, const ArbUt::StringView& scriptName) const {
|
2019-11-18 07:29:17 +00:00
|
|
|
return _scriptResolver->LoadScript(category, scriptName);
|
2020-04-21 10:31:53 +00:00
|
|
|
}
|