Rework script handling to use smart pointers properly
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -44,7 +44,8 @@ const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() co
|
||||
|
||||
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
|
||||
|
||||
BattleScript* nullable BattleLibrary::LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner, ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) const {
|
||||
return _scriptResolver->LoadScript(owner, category, scriptName);
|
||||
ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) const {
|
||||
return _scriptResolver->LoadScript(owner, category, scriptName).TakeOwnership();
|
||||
}
|
||||
@@ -44,9 +44,9 @@ namespace CreatureLib::Battling {
|
||||
return _scriptResolver;
|
||||
}
|
||||
|
||||
[[nodiscard]] BattleScript* nullable LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) const;
|
||||
[[nodiscard]] ArbUt::OptionalUniquePtr<BattleScript> LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user