1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-26 17:39:45 +00:00
openmw/apps/opencs/model/world/ref.cpp

42 lines
860 B
C++
Raw Normal View History

#include "ref.hpp"
2015-01-09 11:05:16 +00:00
#include <cmath>
CSMWorld::CellRef::CellRef()
: mIdNum(0)
{
mId.clear();
mCell.clear();
mOriginalCell.clear();
mRefNum.mIndex = 0;
mRefNum.mContentFile = 0;
2015-01-09 11:05:16 +00:00
}
CSMWorld::CellRef::CellRef (CSMWorld::CellRef&& other) : ESM::CellRef (other)
{
*this = std::move(other);
}
CSMWorld::CellRef& CSMWorld::CellRef::operator= (CSMWorld::CellRef&& other)
{
if (this != &other)
{
ESM::CellRef::operator= (other);
mIdNum = other.mIdNum;
mId = std::move(other.mId);
mCell = std::move(other.mCell);
mOriginalCell = std::move(other.mOriginalCell);
}
return *this;
}
2015-01-09 11:05:16 +00:00
std::pair<int, int> CSMWorld::CellRef::getCellIndex() const
{
const int cellSize = 8192;
return std::make_pair (
std::floor (mPos.pos[0]/cellSize), std::floor (mPos.pos[1]/cellSize));
}