2019-10-17 12:33:25 +00:00
|
|
|
#include "BattleLibrary.hpp"
|
|
|
|
|
2019-11-18 17:41:55 +00:00
|
|
|
using namespace CreatureLib::Battling;
|
|
|
|
|
2020-03-26 21:46:14 +00:00
|
|
|
BattleLibrary::BattleLibrary(const Library::DataLibrary* staticLib,
|
|
|
|
std::unique_ptr<BattleStatCalculator> statCalculator,
|
|
|
|
std::unique_ptr<DamageLibrary> damageLibrary,
|
|
|
|
std::unique_ptr<ExperienceLibrary> experienceLibrary,
|
|
|
|
std::unique_ptr<ScriptResolver> scriptResolver, std::unique_ptr<MiscLibrary> miscLibrary)
|
|
|
|
: _staticLib(staticLib), _statCalculator(std::move(statCalculator)), _damageLibrary(std::move(damageLibrary)),
|
|
|
|
_experienceLibrary(std::move(experienceLibrary)), _scriptResolver(std::move(scriptResolver)),
|
|
|
|
_miscLibrary(std::move(miscLibrary)) {}
|
|
|
|
|
|
|
|
BattleLibrary::~BattleLibrary() { delete _staticLib; }
|
|
|
|
|
|
|
|
const std::unique_ptr<BattleStatCalculator>& BattleLibrary::GetStatCalculator() const noexcept {
|
|
|
|
return _statCalculator;
|
2020-03-25 18:07:36 +00:00
|
|
|
}
|
2019-11-05 13:31:54 +00:00
|
|
|
|
2020-03-26 21:46:14 +00:00
|
|
|
const std::unique_ptr<DamageLibrary>& BattleLibrary::GetDamageLibrary() const noexcept { return _damageLibrary; }
|
2019-11-05 13:31:54 +00:00
|
|
|
|
2020-03-26 21:46:14 +00:00
|
|
|
const std::unique_ptr<MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
|
2019-11-05 16:42:45 +00:00
|
|
|
|
2020-02-28 18:23:24 +00:00
|
|
|
Script* BattleLibrary::LoadScript(ScriptCategory category, const ConstString& scriptName) const {
|
2019-11-18 07:29:17 +00:00
|
|
|
return _scriptResolver->LoadScript(category, scriptName);
|
|
|
|
}
|