1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-22 16:11:33 +00:00

Remove more c++11 dependencies.

This commit is contained in:
cc9cii 2015-06-24 22:19:27 +10:00
parent 0cf9832017
commit e5e4a04f8b

View file

@ -1122,8 +1122,11 @@ void CSMWorld::WeaponRefIdAdapter::setData (const RefIdColumn *column, RefIdData
} }
} }
namespace CSMWorld
{
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::addNestedRow (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::NPC>::addNestedRow (const RefIdColumn *column,
RefIdData& data, int index, int position) const RefIdData& data, int index, int position) const
{ {
Record<ESM::NPC>& record = Record<ESM::NPC>& record =
@ -1147,7 +1150,7 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::addNestedRow (const RefIdColum
} }
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::removeNestedRow (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::NPC>::removeNestedRow (const RefIdColumn *column,
RefIdData& data, int index, int rowToRemove) const RefIdData& data, int index, int rowToRemove) const
{ {
Record<ESM::NPC>& record = Record<ESM::NPC>& record =
@ -1178,7 +1181,7 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::removeNestedRow (const RefIdCo
} }
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::setNestedData (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::NPC>::setNestedData (const RefIdColumn *column,
RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
{ {
Record<ESM::NPC>& record = Record<ESM::NPC>& record =
@ -1211,13 +1214,13 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::setNestedData (const RefIdColu
} }
template <> template <>
QVariant CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::getNestedData (const RefIdColumn *column, QVariant NestedSpellRefIdAdapter<ESM::NPC>::getNestedData (const RefIdColumn *column,
const RefIdData& data, int index, int subRowIndex, int subColIndex) const const RefIdData& data, int index, int subRowIndex, int subColIndex) const
{ {
const Record<ESM::NPC>& record = const Record<ESM::NPC>& record =
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
const std::vector<CSMWorld::SpellInfo>& spells = mData.npcAutoCalculate(record.get())->spells(); const std::vector<SpellInfo>& spells = mData.npcAutoCalculate(record.get())->spells();
if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size())) if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size()))
throw std::runtime_error ("index out of range"); throw std::runtime_error ("index out of range");
@ -1235,24 +1238,24 @@ QVariant CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::getNestedData (const RefId
} }
template <> template <>
int CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::getNestedColumnsCount(const RefIdColumn *column, int NestedSpellRefIdAdapter<ESM::NPC>::getNestedColumnsCount(const RefIdColumn *column,
const RefIdData& data) const const RefIdData& data) const
{ {
return 5; return 5;
} }
template <> template <>
int CSMWorld::NestedSpellRefIdAdapter<ESM::NPC>::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const int NestedSpellRefIdAdapter<ESM::NPC>::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
{ {
const Record<ESM::NPC>& record = const Record<ESM::NPC>& record =
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
const std::vector<CSMWorld::SpellInfo> spells = mData.npcAutoCalculate(record.get())->spells(); const std::vector<SpellInfo> spells = mData.npcAutoCalculate(record.get())->spells();
return static_cast<int>(spells.size()); return static_cast<int>(spells.size());
} }
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::addNestedRow (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::Creature>::addNestedRow (const RefIdColumn *column,
RefIdData& data, int index, int position) const RefIdData& data, int index, int position) const
{ {
Record<ESM::Creature>& record = Record<ESM::Creature>& record =
@ -1272,7 +1275,7 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::addNestedRow (const RefId
} }
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::removeNestedRow (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::Creature>::removeNestedRow (const RefIdColumn *column,
RefIdData& data, int index, int rowToRemove) const RefIdData& data, int index, int rowToRemove) const
{ {
Record<ESM::Creature>& record = Record<ESM::Creature>& record =
@ -1290,7 +1293,7 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::removeNestedRow (const Re
} }
template <> template <>
void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::setNestedData (const RefIdColumn *column, void NestedSpellRefIdAdapter<ESM::Creature>::setNestedData (const RefIdColumn *column,
RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
{ {
Record<ESM::Creature>& record = Record<ESM::Creature>& record =
@ -1310,7 +1313,7 @@ void CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::setNestedData (const RefI
} }
template<> template<>
QVariant CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::getNestedData (const RefIdColumn *column, QVariant NestedSpellRefIdAdapter<ESM::Creature>::getNestedData (const RefIdColumn *column,
const RefIdData& data, int index, int subRowIndex, int subColIndex) const const RefIdData& data, int index, int subRowIndex, int subColIndex) const
{ {
const Record<ESM::Creature>& record = const Record<ESM::Creature>& record =
@ -1337,17 +1340,19 @@ QVariant CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::getNestedData (const
} }
template <> template <>
int CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::getNestedColumnsCount(const RefIdColumn *column, int NestedSpellRefIdAdapter<ESM::Creature>::getNestedColumnsCount(const RefIdColumn *column,
const RefIdData& data) const const RefIdData& data) const
{ {
return 2; return 2;
} }
template <> template <>
int CSMWorld::NestedSpellRefIdAdapter<ESM::Creature>::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const int NestedSpellRefIdAdapter<ESM::Creature>::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
{ {
const Record<ESM::Creature>& record = const Record<ESM::Creature>& record =
static_cast<const Record<ESM::Creature>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<const Record<ESM::Creature>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
return static_cast<int>(record.get().mSpells.mList.size()); return static_cast<int>(record.get().mSpells.mList.size());
} }
}