1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 03:23:54 +00:00
openmw/apps/opencs/model/world/collectionbase.cpp
fteppe 20da0892ef openMW_test_suite compiles and runs
Slowly moving through the open-cs errors

Good progress in openCS

Very good progress on openCS

Getting closer with openCS

OpenCS compiles and runs! Didn't have time to test it all though

ix openMW

everything compiles on windows??

Fix gcc

Fix Clang
2022-12-27 19:15:55 +01:00

38 lines
905 B
C++

#include "collectionbase.hpp"
#include <stdexcept>
#include <apps/opencs/model/world/columns.hpp>
#include <apps/opencs/model/world/universalid.hpp>
#include "columnbase.hpp"
CSMWorld::CollectionBase::CollectionBase() {}
CSMWorld::CollectionBase::~CollectionBase() {}
int CSMWorld::CollectionBase::getInsertIndex(const std::string& id, UniversalId::Type type, RecordBase* record) const
{
return getAppendIndex(ESM::RefId::stringRefId(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;
}