Changed LoadScript to StringView.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-06-26 18:23:40 +02:00
parent 48639eeee5
commit 772619db0f
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
7 changed files with 7 additions and 9 deletions

View File

@ -44,6 +44,6 @@ const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() co
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
Script* BattleLibrary::LoadScript(ScriptCategory category, const ArbUt::BasicStringView& scriptName) const {
Script* BattleLibrary::LoadScript(ScriptCategory category, const ArbUt::StringView& scriptName) const {
return _scriptResolver->LoadScript(category, scriptName);
}

View File

@ -41,7 +41,7 @@ namespace CreatureLib::Battling {
return _experienceLibrary;
}
[[nodiscard]] Script* LoadScript(ScriptCategory category, const ArbUt::BasicStringView& scriptName) const;
[[nodiscard]] Script* LoadScript(ScriptCategory category, const ArbUt::StringView& scriptName) const;
};
}

View File

@ -129,7 +129,7 @@ void Battle::ValidateBattleState() {
this->_battleResult = BattleResult::Conclusive(winningSide);
this->_hasEnded = true;
}
void Battle::AddVolatileScript(const ArbUt::BasicStringView& key) {
void Battle::AddVolatileScript(const ArbUt::StringView& key) {
auto script = _volatile.Get(key);
if (script != nullptr) {
script->Stack();

View File

@ -85,7 +85,7 @@ namespace CreatureLib::Battling {
const ArbUt::UniquePtrList<BattleSide>& GetSides() const noexcept { return _sides; }
ArbUt::BorrowedPtr<Script> GetVolatileScript(const ArbUt::StringView& key) const { return _volatile.Get(key); }
ArbUt::BorrowedPtr<Script> GetVolatileScript(uint32_t keyHash) const noexcept { return _volatile.Get(keyHash); }
void AddVolatileScript(const ArbUt::BasicStringView& key);
void AddVolatileScript(const ArbUt::StringView& key);
void AddVolatileScript(Script* script);
void RemoveVolatileScript(const ArbUt::BasicStringView& name) { _volatile.Remove(name); }
void RemoveVolatileScript(uint32_t keyHash) { _volatile.Remove(keyHash); }

View File

@ -239,7 +239,7 @@ void Battling::Creature::SetHeldItem(uint32_t itemNameHash) {
_heldItem = item;
}
void Battling::Creature::AddVolatileScript(const ArbUt::BasicStringView& name) {
void Battling::Creature::AddVolatileScript(const ArbUt::StringView& name) {
auto script = _volatile.Get(name);
if (script != nullptr) {
script->Stack();

View File

@ -128,7 +128,7 @@ namespace CreatureLib::Battling {
size_t ScriptCount() const override;
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override;
void ClearVolatileScripts();
void AddVolatileScript(const ArbUt::BasicStringView& name);
void AddVolatileScript(const ArbUt::StringView& name);
void AddVolatileScript(Script* script);
void RemoveVolatileScript(const ArbUt::BasicStringView& name);
void RemoveVolatileScript(Script* script);

View File

@ -14,9 +14,7 @@ namespace CreatureLib::Battling {
virtual ~ScriptResolver() = default;
virtual void Initialize(BattleLibrary* library){};
virtual Script* LoadScript(ScriptCategory category, const ArbUt::BasicStringView& scriptName) {
return nullptr;
};
virtual Script* LoadScript(ScriptCategory category, const ArbUt::StringView& scriptName) { return nullptr; };
};
}