mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-05 12:11:34 +00:00
ESM::Dialogue Lua bindings 6
This commit is contained in:
parent
1e36b17679
commit
c1639e54b1
1 changed files with 20 additions and 2 deletions
|
@ -38,7 +38,11 @@ namespace
|
||||||
DecoratedIterator mIter;
|
DecoratedIterator mIter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
using iterator_category = DecoratedIterator::iterator_category;
|
||||||
|
using value_type = DecoratedIterator::value_type;
|
||||||
using difference_type = DecoratedIterator::difference_type;
|
using difference_type = DecoratedIterator::difference_type;
|
||||||
|
using pointer = DecoratedIterator::pointer;
|
||||||
|
using reference = DecoratedIterator::reference;
|
||||||
|
|
||||||
FilteredDialogueIterator(const DecoratedIterator& decoratedIterator)
|
FilteredDialogueIterator(const DecoratedIterator& decoratedIterator)
|
||||||
: mIter{ decoratedIterator }
|
: mIter{ decoratedIterator }
|
||||||
|
@ -64,14 +68,28 @@ namespace
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilteredDialogueIterator& operator+=(difference_type advance)
|
||||||
|
{
|
||||||
|
while (advance > 0)
|
||||||
|
{
|
||||||
|
std::advance(mIter, 1);
|
||||||
|
if (mIter->mType != filter)
|
||||||
|
{
|
||||||
|
--advance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const FilteredDialogueIterator& x) const { return mIter == x.mIter; }
|
bool operator==(const FilteredDialogueIterator& x) const { return mIter == x.mIter; }
|
||||||
|
|
||||||
bool operator!=(const FilteredDialogueIterator& x) const { return not(*this == x); }
|
bool operator!=(const FilteredDialogueIterator& x) const { return not(*this == x); }
|
||||||
|
|
||||||
const ESM::Dialogue& operator*() const { return *mIter; }
|
const value_type& operator*() const { return *mIter; }
|
||||||
|
|
||||||
const ESM::Dialogue* operator->() const { return &(*mIter); }
|
const value_type* operator->() const { return &(*mIter); }
|
||||||
};
|
};
|
||||||
|
|
||||||
using iterator = FilteredDialogueIterator;
|
using iterator = FilteredDialogueIterator;
|
||||||
|
|
||||||
const ESM::Dialogue* search(const ESM::RefId& id) const
|
const ESM::Dialogue* search(const ESM::RefId& id) const
|
||||||
|
|
Loading…
Reference in a new issue