1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/apps/openmw/mwworld/recordcmp.hpp
2019-02-19 18:40:33 +03:00

34 lines
920 B
C++

#ifndef OPENMW_MWWORLD_RECORDCMP_H
#define OPENMW_MWWORLD_RECORDCMP_H
#include <components/esm/records.hpp>
#include <components/misc/stringops.hpp>
namespace MWWorld
{
struct RecordCmp
{
template <class T>
bool operator()(const T &x, const T& y) const {
return x.mId < y.mId;
}
};
template <>
inline bool RecordCmp::operator()<ESM::Dialogue>(const ESM::Dialogue &x, const ESM::Dialogue &y) const {
return Misc::StringUtils::ciLess(x.mId, y.mId);
}
template <>
inline bool RecordCmp::operator()<ESM::Cell>(const ESM::Cell &x, const ESM::Cell &y) const {
return Misc::StringUtils::ciLess(x.mName, y.mName);
}
template <>
inline bool RecordCmp::operator()<ESM::Pathgrid>(const ESM::Pathgrid &x, const ESM::Pathgrid &y) const {
return Misc::StringUtils::ciLess(x.mCell, y.mCell);
}
} // end namespace
#endif