1 #ifndef CSM_WOLRD_NESTEDCOLADAPTERIMP_H
2 #define CSM_WOLRD_NESTEDCOLADAPTERIMP_H
43 int subRowIndex,
int subColIndex)
const;
46 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
68 int subRowIndex,
int subColIndex)
const;
71 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
93 int subRowIndex,
int subColIndex)
const;
96 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
118 int subRowIndex,
int subColIndex)
const;
121 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
128 template<
typename ESXRecordT>
136 ESXRecordT raceOrBthSgn = record.
get();
138 std::vector<std::string>& spells = raceOrBthSgn.mPowers.mList;
141 std::string spell =
"";
143 spells.insert(spells.begin()+position, spell);
150 ESXRecordT raceOrBthSgn = record.
get();
152 std::vector<std::string>& spells = raceOrBthSgn.mPowers.mList;
154 if (rowToRemove < 0 || rowToRemove >= static_cast<int> (spells.size()))
155 throw std::runtime_error (
"index out of range");
157 spells.erase(spells.begin()+rowToRemove);
164 ESXRecordT raceOrBthSgn = record.
get();
166 raceOrBthSgn.mPowers.mList =
180 ESXRecordT raceOrBthSgn = record.
get();
182 std::vector<std::string>& spells = raceOrBthSgn.mPowers.mList;
184 if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size()))
185 throw std::runtime_error (
"index out of range");
187 std::string spell = spells[subRowIndex];
190 case 0:
return QString(spell.c_str());
191 default:
throw std::runtime_error(
"Spells subcolumn index out of range");
196 int subRowIndex,
int subColIndex)
const
198 ESXRecordT raceOrBthSgn = record.
get();
200 std::vector<std::string>& spells = raceOrBthSgn.mPowers.mList;
202 if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size()))
203 throw std::runtime_error (
"index out of range");
205 std::string spell = spells[subRowIndex];
208 case 0: spell = value.toString().toUtf8().constData();
break;
209 default:
throw std::runtime_error(
"Spells subcolumn index out of range");
212 raceOrBthSgn.mPowers.mList[subRowIndex] = spell;
224 return static_cast<int>(record.
get().mPowers.mList.size());
228 template<
typename ESXRecordT>
236 ESXRecordT magic = record.
get();
238 std::vector<ESM::ENAMstruct>& effectsList = magic.mEffects.mList;
251 effectsList.insert(effectsList.begin()+position, effect);
258 ESXRecordT magic = record.
get();
260 std::vector<ESM::ENAMstruct>& effectsList = magic.mEffects.mList;
262 if (rowToRemove < 0 || rowToRemove >= static_cast<int> (effectsList.size()))
263 throw std::runtime_error (
"index out of range");
265 effectsList.erase(effectsList.begin()+rowToRemove);
272 ESXRecordT magic = record.
get();
274 magic.mEffects.mList =
288 ESXRecordT magic = record.
get();
290 std::vector<ESM::ENAMstruct>& effectsList = magic.mEffects.mList;
292 if (subRowIndex < 0 || subRowIndex >= static_cast<int> (effectsList.size()))
293 throw std::runtime_error (
"index out of range");
303 throw std::runtime_error(
"Magic effects ID unexpected value");
338 throw std::runtime_error(
"Magic effects range unexpected value");
340 case 4:
return effect.
mArea;
344 default:
throw std::runtime_error(
"Magic Effects subcolumn index out of range");
349 int subRowIndex,
int subColIndex)
const
351 ESXRecordT magic = record.
get();
353 std::vector<ESM::ENAMstruct>& effectsList = magic.mEffects.mList;
355 if (subRowIndex < 0 || subRowIndex >= static_cast<int> (effectsList.size()))
356 throw std::runtime_error (
"index out of range");
363 effect.
mEffectID =
static_cast<short>(value.toInt());
368 effect.
mSkill =
static_cast<signed char>(value.toInt());
373 effect.
mAttribute =
static_cast<signed char>(value.toInt());
378 effect.
mRange = value.toInt();
381 case 4: effect.
mArea = value.toInt();
break;
382 case 5: effect.
mDuration = value.toInt();
break;
383 case 6: effect.
mMagnMin = value.toInt();
break;
384 case 7: effect.
mMagnMax = value.toInt();
break;
385 default:
throw std::runtime_error(
"Magic Effects subcolumn index out of range");
388 magic.mEffects.mList[subRowIndex] = effect;
400 return static_cast<int>(record.
get().mEffects.mList.size());
419 int subRowIndex,
int subColIndex)
const;
422 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
444 int subRowIndex,
int subColIndex)
const;
447 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
469 int subRowIndex,
int subColIndex)
const;
472 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
494 int subRowIndex,
int subColIndex)
const;
497 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
519 int subRowIndex,
int subColIndex)
const;
522 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
544 int subRowIndex,
int subColIndex)
const;
547 const QVariant& value,
int subRowIndex,
int subColIndex)
const;
555 #endif // CSM_WOLRD_NESTEDCOLADAPTERIMP_H
int mMagnMax
Definition: effectlist.hpp:28
virtual void setData(Record< CSMWorld::Cell > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:893
Definition: loadmgef.hpp:190
virtual QVariant getData(const Record< Pathgrid > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:166
virtual NestedTableWrapperBase * table(const Record< ESM::Faction > &record) const
Definition: nestedcoladapterimp.cpp:260
virtual int getRowsCount(const Record< CSMWorld::Cell > &record) const
Definition: nestedcoladapterimp.cpp:988
Definition: nestedtablewrapper.hpp:6
RegionWeatherAdapter()
Definition: nestedcoladapterimp.cpp:993
SpellListAdapter()
Definition: nestedcoladapterimp.hpp:132
virtual int getColumnsCount(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:485
virtual int getRowsCount(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:754
virtual int getRowsCount(const Record< ESM::Faction > &record) const
Definition: nestedcoladapterimp.cpp:332
virtual void setData(Record< Info > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:593
virtual void setTable(Record< ESM::Region > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:369
Definition: loadmgef.hpp:181
virtual int getColumnsCount(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:672
Definition: loadmgef.hpp:129
virtual void setTable(Record< Info > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:528
virtual void addRow(Record< ESM::Race > &record, int position) const
Definition: nestedcoladapterimp.cpp:684
Definition: nestedcoladapterimp.hpp:229
virtual void removeRow(Record< Info > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:514
Definition: nestedcoladapterimp.hpp:529
virtual NestedTableWrapperBase * table(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:172
EffectsListAdapter()
Definition: nestedcoladapterimp.hpp:232
virtual int getRowsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:222
virtual void addRow(Record< ESM::Region > &record, int position) const
Definition: nestedcoladapterimp.cpp:995
virtual void setTable(Record< CSMWorld::Cell > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:847
virtual void addRow(Record< Pathgrid > &record, int position) const
Definition: nestedcoladapterimp.cpp:15
virtual void setTable(Record< Pathgrid > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:53
signed char mSkill
Definition: effectlist.hpp:24
virtual void setData(Record< Pathgrid > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:83
virtual NestedTableWrapperBase * table(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:782
virtual int getColumnsCount(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:824
Definition: nestedcoladapterimp.hpp:429
virtual void setTable(Record< Info > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:450
Definition: nestedcoladapterimp.hpp:103
virtual void setTable(Record< ESM::Race > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:694
RaceSkillsBonusAdapter()
Definition: nestedcoladapterimp.cpp:759
virtual void removeRow(Record< Info > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:445
virtual QVariant getData(const Record< Pathgrid > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:69
Definition: loadmgef.hpp:128
virtual QVariant getData(const Record< ESM::Race > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:790
virtual void setData(Record< ESXRecordT > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:348
virtual QVariant getData(const Record< CSMWorld::Cell > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:858
virtual void removeRow(Record< CSMWorld::Cell > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:842
Definition: loadmgef.hpp:186
PathgridPointListAdapter()
Definition: nestedcoladapterimp.cpp:13
Definition: effectlist.hpp:17
FactionReactionsAdapter()
Definition: nestedcoladapterimp.cpp:216
short mEffectID
Definition: effectlist.hpp:20
virtual void setData(Record< ESM::Region > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:405
virtual QVariant getData(const Record< Info > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:461
virtual void setData(Record< Info > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:472
virtual int getColumnsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:217
RaceAttributeAdapter()
Definition: nestedcoladapterimp.cpp:682
virtual void removeRow(Record< ESM::Region > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:355
virtual void removeRow(Record< ESM::Faction > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:230
Definition: loadmgef.hpp:255
virtual int getColumnsCount(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:102
virtual void setData(Record< ESM::Race > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:806
virtual int getColumnsCount(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:749
PathgridEdgeListAdapter()
Definition: nestedcoladapterimp.cpp:112
virtual void addRow(Record< Info > &record, int position) const
Definition: nestedcoladapterimp.cpp:497
Definition: nestedcolumnadapter.hpp:11
Definition: nestedcoladapterimp.hpp:404
Definition: nestedcoladapterimp.hpp:454
virtual NestedTableWrapperBase * table(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:456
virtual int getRowsCount(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:433
int mMagnMin
Definition: effectlist.hpp:28
virtual int getRowsCount(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:107
virtual int getColumnsCount(const Record< CSMWorld::Cell > &record) const
Definition: nestedcoladapterimp.cpp:983
virtual int getRowsCount(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:490
virtual int getColumnsCount(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:206
virtual void setTable(Record< ESM::Race > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:771
Definition: loadmgef.hpp:133
virtual int getRowsCount(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:829
virtual QVariant getData(const Record< ESM::Region > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:386
virtual void removeRow(Record< ESM::Region > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:1000
virtual NestedTableWrapperBase * table(const Record< ESM::Race > &record) const
Definition: nestedcoladapterimp.cpp:705
virtual void removeRow(Record< ESM::Race > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:766
virtual QVariant getData(const Record< Info > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:545
int mArea
Definition: effectlist.hpp:28
Definition: nestedcoladapterimp.hpp:28
virtual void setTable(Record< ESXRecordT > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.hpp:270
virtual NestedTableWrapperBase * table(const Record< CSMWorld::Cell > &record) const
Definition: nestedcoladapterimp.cpp:853
virtual void removeRow(Record< Pathgrid > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:135
Definition: loadmgef.hpp:192
virtual NestedTableWrapperBase * table(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:1010
virtual void addRow(Record< Pathgrid > &record, int position) const
Definition: nestedcoladapterimp.cpp:114
virtual void addRow(Record< Info > &record, int position) const
Definition: nestedcoladapterimp.cpp:440
RegionSoundListAdapter()
Definition: nestedcoladapterimp.cpp:337
virtual void addRow(Record< ESM::Faction > &record, int position) const
Definition: nestedcoladapterimp.cpp:218
virtual int getColumnsCount(const Record< ESM::Faction > &record) const
Definition: nestedcoladapterimp.cpp:327
Definition: nestedcoladapterimp.hpp:504
virtual QVariant getData(const Record< ESXRecordT > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:178
Definition: nestedcoladapterimp.hpp:479
virtual void addRow(Record< CSMWorld::Cell > &record, int position) const
Definition: nestedcoladapterimp.cpp:837
const ESXRecordT & get() const
Throws an exception, if the record is deleted.
Definition: record.hpp:106
Definition: loadmgef.hpp:185
virtual int getColumnsCount(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:428
virtual void setData(Record< ESM::Race > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:730
virtual QVariant getData(const Record< ESM::Region > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:1015
virtual void addRow(Record< ESXRecordT > &record, int position) const
Definition: nestedcoladapterimp.hpp:134
virtual void setTable(Record< Pathgrid > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:149
InfoConditionAdapter()
Definition: nestedcoladapterimp.cpp:495
virtual void removeRow(Record< Pathgrid > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:36
virtual void removeRow(Record< ESM::Race > &record, int rowToRemove) const
Definition: nestedcoladapterimp.cpp:689
virtual NestedTableWrapperBase * table(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:63
int mRange
Definition: effectlist.hpp:27
virtual void setTable(Record< ESM::Region > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:1005
virtual void setData(Record< ESM::Faction > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:289
Definition: nestedcolumnadapter.hpp:14
void setModified(const ESXRecordT &modified)
Throws an exception, if the record is deleted.
Definition: record.hpp:133
virtual int getRowsCount(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:1089
virtual NestedTableWrapperBase * table(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:160
Definition: nestedcoladapterimp.hpp:129
virtual void removeRow(Record< ESXRecordT > &record, int rowToRemove) const
Definition: nestedcoladapterimp.hpp:148
virtual int getRowsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:398
virtual void addRow(Record< ESM::Race > &record, int position) const
Definition: nestedcoladapterimp.cpp:761
signed char mAttribute
Definition: effectlist.hpp:24
virtual QVariant getData(const Record< ESM::Race > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:713
Definition: loadmgef.hpp:124
Definition: nestedtablewrapper.hpp:16
virtual NestedTableWrapperBase * table(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:380
virtual NestedTableWrapperBase * table(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:539
virtual void removeRow(Record< ESXRecordT > &record, int rowToRemove) const
Definition: nestedcoladapterimp.hpp:256
virtual NestedTableWrapperBase * table(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:280
int mDuration
Definition: effectlist.hpp:28
virtual void setData(Record< Pathgrid > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:184
virtual void addRow(Record< ESM::Region > &record, int position) const
Definition: nestedcoladapterimp.cpp:339
virtual void addRow(Record< ESXRecordT > &record, int position) const
Definition: nestedcoladapterimp.hpp:234
CellListAdapter()
Definition: nestedcoladapterimp.cpp:835
Definition: nestedcoladapterimp.hpp:53
virtual QVariant getData(const Record< ESXRecordT > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:286
InfoListAdapter()
Definition: nestedcoladapterimp.cpp:438
virtual int getColumnsCount(const Record< ESM::Region > &record) const
Definition: nestedcoladapterimp.cpp:1084
Definition: loadmgef.hpp:196
virtual int getRowsCount(const Record< Pathgrid > &record) const
Definition: nestedcoladapterimp.cpp:211
virtual void setTable(Record< ESM::Faction > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.cpp:249
virtual int getRowsCount(const Record< Info > &record) const
Definition: nestedcoladapterimp.cpp:677
Definition: nestedcoladapterimp.hpp:78
virtual void setData(Record< ESXRecordT > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:195
virtual QVariant getData(const Record< ESM::Faction > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:266
virtual void setTable(Record< ESXRecordT > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.hpp:162
virtual int getColumnsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:393
virtual void setData(Record< ESM::Region > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.cpp:1057