1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/opencs/model/world/collectionbase.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
784 B
C++
Raw Normal View History

#include "collectionbase.hpp"
#include <stdexcept>
2022-10-19 19:02:00 +02:00
#include <apps/opencs/model/world/columns.hpp>
#include <apps/opencs/model/world/universalid.hpp>
#include "columnbase.hpp"
int CSMWorld::CollectionBase::getInsertIndex(const ESM::RefId& id, UniversalId::Type type, RecordBase* record) const
{
return getAppendIndex(id, type);
}
int CSMWorld::CollectionBase::searchColumnIndex(Columns::ColumnId id) const
{
int columns = getColumns();
for (int i = 0; i < columns; ++i)
if (getColumn(i).mColumnId == id)
return i;
return -1;
}
int CSMWorld::CollectionBase::findColumnIndex(Columns::ColumnId id) const
{
int index = searchColumnIndex(id);
if (index == -1)
throw std::logic_error("invalid column index");
return index;
2015-03-11 10:54:45 -04:00
}