2015-04-02 10:02:17 +00:00
|
|
|
#include "nestedcollection.hpp"
|
|
|
|
|
2015-04-09 09:11:19 +00:00
|
|
|
CSMWorld::NestedCollection::NestedCollection()
|
2015-04-02 10:02:17 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
CSMWorld::NestedCollection::~NestedCollection()
|
|
|
|
{}
|
2015-04-09 09:11:19 +00:00
|
|
|
|
|
|
|
int CSMWorld::NestedCollection::getNestedRowsCount(int row, int column) const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CSMWorld::NestedCollection::getNestedColumnsCount(int row, int column) const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-26 19:14:11 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|