mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
various bits of cleanup
This commit is contained in:
parent
83ded18af0
commit
bfcd768078
4 changed files with 162 additions and 142 deletions
|
@ -430,6 +430,11 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CellStore::isExterior() const
|
||||||
|
{
|
||||||
|
return mCell->isExterior();
|
||||||
|
}
|
||||||
|
|
||||||
Ptr CellStore::searchInContainer (const std::string& id)
|
Ptr CellStore::searchInContainer (const std::string& id)
|
||||||
{
|
{
|
||||||
if (Ptr ptr = searchInContainerList (mContainers, id))
|
if (Ptr ptr = searchInContainerList (mContainers, id))
|
||||||
|
@ -637,4 +642,14 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator== (const CellStore& left, const CellStore& right)
|
||||||
|
{
|
||||||
|
return left.getCell()->getCellId()==right.getCell()->getCellId();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator!= (const CellStore& left, const CellStore& right)
|
||||||
|
{
|
||||||
|
return !(left==right);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef GAME_MWWORLD_CELLSTORE_H
|
#ifndef GAME_MWWORLD_CELLSTORE_H
|
||||||
#define GAME_MWWORLD_CELLSTORE_H
|
#define GAME_MWWORLD_CELLSTORE_H
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
@ -82,10 +81,11 @@ namespace MWWorld
|
||||||
int count() const;
|
int count() const;
|
||||||
///< Return total number of references, including deleted ones.
|
///< Return total number of references, including deleted ones.
|
||||||
|
|
||||||
|
|
||||||
void load (const MWWorld::ESMStore &store, std::vector<ESM::ESMReader> &esm);
|
void load (const MWWorld::ESMStore &store, std::vector<ESM::ESMReader> &esm);
|
||||||
|
///< Load references from content file.
|
||||||
|
|
||||||
void preload (const MWWorld::ESMStore &store, std::vector<ESM::ESMReader> &esm);
|
void preload (const MWWorld::ESMStore &store, std::vector<ESM::ESMReader> &esm);
|
||||||
|
///< Build ID list from content file.
|
||||||
|
|
||||||
/// Call functor (ref) for each reference. functor must return a bool. Returning
|
/// Call functor (ref) for each reference. functor must return a bool. Returning
|
||||||
/// false will abort the iteration.
|
/// false will abort the iteration.
|
||||||
|
@ -118,19 +118,7 @@ namespace MWWorld
|
||||||
forEachImp (functor, mCreatureLists);
|
forEachImp (functor, mCreatureLists);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const CellStore &cell) {
|
bool isExterior() const;
|
||||||
return mCell->mName == cell.mCell->mName &&
|
|
||||||
mCell->mData.mX == cell.mCell->mData.mX &&
|
|
||||||
mCell->mData.mY == cell.mCell->mData.mY;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(const CellStore &cell) {
|
|
||||||
return !(*this == cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isExterior() const {
|
|
||||||
return mCell->isExterior();
|
|
||||||
}
|
|
||||||
|
|
||||||
Ptr searchInContainer (const std::string& id);
|
Ptr searchInContainer (const std::string& id);
|
||||||
|
|
||||||
|
@ -293,6 +281,9 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
return mWeapons;
|
return mWeapons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator== (const CellStore& left, const CellStore& right);
|
||||||
|
bool operator!= (const CellStore& left, const CellStore& right);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,3 +24,14 @@ void ESM::CellId::save (ESMWriter &esm) const
|
||||||
if (mPaged)
|
if (mPaged)
|
||||||
esm.writeHNT ("CIDX", mIndex, 8);
|
esm.writeHNT ("CIDX", mIndex, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ESM::operator== (const CellId& left, const CellId& right)
|
||||||
|
{
|
||||||
|
return left.mWorldspace==right.mWorldspace && left.mPaged==right.mPaged &&
|
||||||
|
(!left.mPaged || (left.mIndex.mX==right.mIndex.mX && left.mIndex.mY==right.mIndex.mY));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ESM::operator!= (const CellId& left, const CellId& right)
|
||||||
|
{
|
||||||
|
return !(left==right);
|
||||||
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ namespace ESM
|
||||||
void load (ESMReader &esm);
|
void load (ESMReader &esm);
|
||||||
void save (ESMWriter &esm) const;
|
void save (ESMWriter &esm) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool operator== (const CellId& left, const CellId& right);
|
||||||
|
bool operator!= (const CellId& left, const CellId& right);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in a new issue