1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 05:53:54 +00:00
openmw/apps/opencs/model/world/nestedcollection.cpp

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

47 lines
1.2 KiB
C++
Raw Normal View History

2015-04-02 10:02:17 +00:00
#include "nestedcollection.hpp"
2022-10-19 17:02:00 +00:00
#include <apps/opencs/model/world/columns.hpp>
#include <stdexcept>
2022-08-19 17:19:42 +00:00
#include "columnbase.hpp"
CSMWorld::NestedCollection::NestedCollection() {}
2015-04-02 10:02:17 +00:00
CSMWorld::NestedCollection::~NestedCollection() {}
int CSMWorld::NestedCollection::getNestedRowsCount(int row, int column) const
{
return 0;
}
int CSMWorld::NestedCollection::getNestedColumnsCount(int row, int column) const
{
return 0;
}
int CSMWorld::NestedCollection::searchNestedColumnIndex(int parentColumn, Columns::ColumnId id)
{
// Assumed that the parentColumn is always a valid index
const NestableColumn* parent = getNestableColumn(parentColumn);
int nestedColumnCount = getNestedColumnsCount(0, parentColumn);
for (int i = 0; i < nestedColumnCount; ++i)
{
if (parent->nestedColumn(i).mColumnId == id)
{
return i;
}
}
return -1;
}
int CSMWorld::NestedCollection::findNestedColumnIndex(int parentColumn, Columns::ColumnId id)
{
int index = searchNestedColumnIndex(parentColumn, id);
if (index == -1)
{
throw std::logic_error("CSMWorld::NestedCollection: No such nested column");
}
return index;
}