mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-15 18:39:51 +00:00
with mutable, without World and ESMStore interface change
This commit is contained in:
parent
9c7835e27f
commit
88fc038ceb
@ -87,11 +87,6 @@ namespace MWWorld
|
|||||||
typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> > PtrMovementList;
|
typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> > PtrMovementList;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MWDialogue
|
|
||||||
{
|
|
||||||
template <typename string_t, typename value_t> class KeywordSearch;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace MWBase
|
namespace MWBase
|
||||||
{
|
{
|
||||||
/// \brief Interface for the World (implemented in MWWorld)
|
/// \brief Interface for the World (implemented in MWWorld)
|
||||||
@ -155,7 +150,6 @@ namespace MWBase
|
|||||||
virtual MWWorld::ConstPtr getPlayerConstPtr() const = 0;
|
virtual MWWorld::ConstPtr getPlayerConstPtr() const = 0;
|
||||||
|
|
||||||
virtual const MWWorld::ESMStore& getStore() const = 0;
|
virtual const MWWorld::ESMStore& getStore() const = 0;
|
||||||
virtual const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() = 0;
|
|
||||||
|
|
||||||
virtual std::vector<ESM::ESMReader>& getEsmReader() = 0;
|
virtual std::vector<ESM::ESMReader>& getEsmReader() = 0;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace MWDialogue
|
|||||||
void tokenizeKeywords(const std::string & text, std::vector<Token> & tokens)
|
void tokenizeKeywords(const std::string & text, std::vector<Token> & tokens)
|
||||||
{
|
{
|
||||||
const auto& keywordSearch =
|
const auto& keywordSearch =
|
||||||
MWBase::Environment::get().getWorld()->getDialogIdKeywordSearch();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().getDialogIdKeywordSearch();
|
||||||
|
|
||||||
std::vector<KeywordSearch<std::string, int /*unused*/>::Match> matches;
|
std::vector<KeywordSearch<std::string, int /*unused*/>::Match> matches;
|
||||||
keywordSearch.highlightKeywords(text.begin(), text.end(), matches);
|
keywordSearch.highlightKeywords(text.begin(), text.end(), matches);
|
||||||
|
@ -284,9 +284,6 @@ namespace MWWorld
|
|||||||
/// Actors with the same ID share spells, abilities, etc.
|
/// Actors with the same ID share spells, abilities, etc.
|
||||||
/// @return The shared spell list to use for this actor and whether or not it has already been initialized.
|
/// @return The shared spell list to use for this actor and whether or not it has already been initialized.
|
||||||
std::pair<std::shared_ptr<MWMechanics::SpellList>, bool> getSpellList(const std::string& id) const;
|
std::pair<std::shared_ptr<MWMechanics::SpellList>, bool> getSpellList(const std::string& id) const;
|
||||||
|
|
||||||
const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() {
|
|
||||||
return mDialogs.getDialogIdKeywordSearch(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -1072,7 +1072,7 @@ namespace MWWorld
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MWDialogue::KeywordSearch<std::string, int>& Store<ESM::Dialogue>::getDialogIdKeywordSearch()
|
const MWDialogue::KeywordSearch<std::string, int>& Store<ESM::Dialogue>::getDialogIdKeywordSearch() const
|
||||||
{
|
{
|
||||||
if (mKeywordSearchModFlag)
|
if (mKeywordSearchModFlag)
|
||||||
{
|
{
|
||||||
|
@ -452,8 +452,8 @@ namespace MWWorld
|
|||||||
/// @warning ESM::Dialogue Store currently implements a sorted order for unknown reasons.
|
/// @warning ESM::Dialogue Store currently implements a sorted order for unknown reasons.
|
||||||
std::vector<ESM::Dialogue*> mShared;
|
std::vector<ESM::Dialogue*> mShared;
|
||||||
|
|
||||||
bool mKeywordSearchModFlag;
|
mutable bool mKeywordSearchModFlag;
|
||||||
MWDialogue::KeywordSearch<std::string, int /*unused*/> mKeywordSearch;
|
mutable MWDialogue::KeywordSearch<std::string, int /*unused*/> mKeywordSearch;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Store();
|
Store();
|
||||||
@ -474,7 +474,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
RecordId load(ESM::ESMReader &esm) override;
|
RecordId load(ESM::ESMReader &esm) override;
|
||||||
|
|
||||||
const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch();
|
const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //end namespace
|
} //end namespace
|
||||||
|
@ -236,9 +236,6 @@ namespace MWWorld
|
|||||||
|
|
||||||
const MWWorld::ESMStore& getStore() const override;
|
const MWWorld::ESMStore& getStore() const override;
|
||||||
|
|
||||||
const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() override {
|
|
||||||
return mStore.getDialogIdKeywordSearch(); }
|
|
||||||
|
|
||||||
std::vector<ESM::ESMReader>& getEsmReader() override;
|
std::vector<ESM::ESMReader>& getEsmReader() override;
|
||||||
|
|
||||||
LocalScripts& getLocalScripts() override;
|
LocalScripts& getLocalScripts() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user