OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
refidadapterimp.hpp
Go to the documentation of this file.
1 #ifndef CSM_WOLRD_REFIDADAPTERIMP_H
2 #define CSM_WOLRD_REFIDADAPTERIMP_H
3 
4 #include <map>
5 
6 #include <QVariant>
7 
13 
14 #include "columnbase.hpp"
15 #include "record.hpp"
16 #include "refiddata.hpp"
17 #include "universalid.hpp"
18 #include "refidadapter.hpp"
19 #include "nestedtablewrapper.hpp"
20 
21 namespace CSMWorld
22 {
23  struct BaseColumns
24  {
25  const RefIdColumn *mId;
28  };
29 
32  template<typename RecordT>
34  {
37 
38  public:
39 
41 
42  virtual std::string getId (const RecordBase& record) const;
43 
44  virtual void setId (RecordBase& record, const std::string& id);
45 
46  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
47  const;
48 
49  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
50  const QVariant& value) const;
52 
53  UniversalId::Type getType() const;
54  };
55 
56  template<typename RecordT>
58  : mType (type), mBase (base)
59  {}
60 
61  template<typename RecordT>
62  void BaseRefIdAdapter<RecordT>::setId (RecordBase& record, const std::string& id)
63  {
64  (dynamic_cast<Record<RecordT>&> (record).get().mId) = id;
65  }
66 
67  template<typename RecordT>
68  std::string BaseRefIdAdapter<RecordT>::getId (const RecordBase& record) const
69  {
70  return dynamic_cast<const Record<RecordT>&> (record).get().mId;
71  }
72 
73  template<typename RecordT>
74  QVariant BaseRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
75  int index) const
76  {
77  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
78  data.getRecord (RefIdData::LocalIndex (index, mType)));
79 
80  if (column==mBase.mId)
81  return QString::fromUtf8 (record.get().mId.c_str());
82 
83  if (column==mBase.mModified)
84  {
86  return static_cast<int> (Record<RecordT>::State_Deleted);
87 
88  return static_cast<int> (record.mState);
89  }
90 
91  if (column==mBase.mType)
92  return static_cast<int> (mType);
93 
94  return QVariant();
95  }
96 
97  template<typename RecordT>
98  void BaseRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
99  const QVariant& value) const
100  {
101  Record<RecordT>& record = static_cast<Record<RecordT>&> (
102  data.getRecord (RefIdData::LocalIndex (index, mType)));
103 
104  if (column==mBase.mModified)
105  record.mState = static_cast<RecordBase::State> (value.toInt());
106  }
107 
108  template<typename RecordT>
110  {
111  return mType;
112  }
113 
114 
115  struct ModelColumns : public BaseColumns
116  {
118 
119  ModelColumns (const BaseColumns& base) : BaseColumns (base) {}
120  };
121 
123  template<typename RecordT>
124  class ModelRefIdAdapter : public BaseRefIdAdapter<RecordT>
125  {
127 
128  public:
129 
130  ModelRefIdAdapter (UniversalId::Type type, const ModelColumns& columns);
131 
132  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
133  const;
134 
135  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
136  const QVariant& value) const;
138  };
139 
140  template<typename RecordT>
142  : BaseRefIdAdapter<RecordT> (type, columns), mModel (columns)
143  {}
144 
145  template<typename RecordT>
146  QVariant ModelRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
147  int index) const
148  {
149  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
151 
152  if (column==mModel.mModel)
153  return QString::fromUtf8 (record.get().mModel.c_str());
154 
155  return BaseRefIdAdapter<RecordT>::getData (column, data, index);
156  }
157 
158  template<typename RecordT>
159  void ModelRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
160  const QVariant& value) const
161  {
162  Record<RecordT>& record = static_cast<Record<RecordT>&> (
164 
165  RecordT record2 = record.get();
166  if (column==mModel.mModel)
167  record2.mModel = value.toString().toUtf8().constData();
168  else
169  {
170  BaseRefIdAdapter<RecordT>::setData (column, data, index, value);
171  return;
172  }
173 
174  record.setModified(record2);
175  }
176 
177  struct NameColumns : public ModelColumns
178  {
181 
182  NameColumns (const ModelColumns& base) : ModelColumns (base) {}
183  };
184 
186  template<typename RecordT>
187  class NameRefIdAdapter : public ModelRefIdAdapter<RecordT>
188  {
190 
191  public:
192 
193  NameRefIdAdapter (UniversalId::Type type, const NameColumns& columns);
194 
195  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
196  const;
197 
198  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
199  const QVariant& value) const;
201  };
202 
203  template<typename RecordT>
205  : ModelRefIdAdapter<RecordT> (type, columns), mName (columns)
206  {}
207 
208  template<typename RecordT>
209  QVariant NameRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
210  int index) const
211  {
212  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
214 
215  if (column==mName.mName)
216  return QString::fromUtf8 (record.get().mName.c_str());
217 
218  if (column==mName.mScript)
219  return QString::fromUtf8 (record.get().mScript.c_str());
220 
221  return ModelRefIdAdapter<RecordT>::getData (column, data, index);
222  }
223 
224  template<typename RecordT>
225  void NameRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
226  const QVariant& value) const
227  {
228  Record<RecordT>& record = static_cast<Record<RecordT>&> (
230 
231  RecordT record2 = record.get();
232  if (column==mName.mName)
233  record2.mName = value.toString().toUtf8().constData();
234  else if (column==mName.mScript)
235  record2.mScript = value.toString().toUtf8().constData();
236  else
237  {
238  ModelRefIdAdapter<RecordT>::setData (column, data, index, value);
239  return;
240  }
241 
242  record.setModified(record2);
243  }
244 
246  {
250 
251  InventoryColumns (const NameColumns& base) : NameColumns (base) {}
252  };
253 
255  template<typename RecordT>
256  class InventoryRefIdAdapter : public NameRefIdAdapter<RecordT>
257  {
259 
260  public:
261 
263 
264  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
265  const;
266 
267  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
268  const QVariant& value) const;
270  };
271 
272  template<typename RecordT>
274  const InventoryColumns& columns)
275  : NameRefIdAdapter<RecordT> (type, columns), mInventory (columns)
276  {}
277 
278  template<typename RecordT>
279  QVariant InventoryRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
280  int index) const
281  {
282  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
284 
285  if (column==mInventory.mIcon)
286  return QString::fromUtf8 (record.get().mIcon.c_str());
287 
288  if (column==mInventory.mWeight)
289  return record.get().mData.mWeight;
290 
291  if (column==mInventory.mValue)
292  return record.get().mData.mValue;
293 
294  return NameRefIdAdapter<RecordT>::getData (column, data, index);
295  }
296 
297  template<typename RecordT>
298  void InventoryRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
299  const QVariant& value) const
300  {
301  Record<RecordT>& record = static_cast<Record<RecordT>&> (
303 
304  RecordT record2 = record.get();
305  if (column==mInventory.mIcon)
306  record2.mIcon = value.toString().toUtf8().constData();
307  else if (column==mInventory.mWeight)
308  record2.mData.mWeight = value.toFloat();
309  else if (column==mInventory.mValue)
310  record2.mData.mValue = value.toInt();
311  else
312  {
313  NameRefIdAdapter<RecordT>::setData (column, data, index, value);
314  return;
315  }
316 
317  record.setModified(record2);
318  }
319 
321  {
323 
324  PotionColumns (const InventoryColumns& columns);
325  };
326 
327  class PotionRefIdAdapter : public InventoryRefIdAdapter<ESM::Potion>
328  {
331 
332  public:
333 
334  PotionRefIdAdapter (const PotionColumns& columns, const RefIdColumn *autoCalc);
335 
336  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
337  const;
338 
339  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
340  const QVariant& value) const;
342  };
343 
345  {
347 
348  IngredientColumns (const InventoryColumns& columns);
349  };
350 
351  class IngredientRefIdAdapter : public InventoryRefIdAdapter<ESM::Ingredient>
352  {
354 
355  public:
356 
357  IngredientRefIdAdapter (const IngredientColumns& columns);
358 
359  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
360  const;
361 
362  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
363  const QVariant& value) const;
365  };
366 
368  {
370 
371  // not implemented
374 
375  public:
376 
378 
379  virtual ~IngredEffectRefIdAdapter();
380 
381  virtual void addNestedRow (const RefIdColumn *column,
382  RefIdData& data, int index, int position) const;
383 
384  virtual void removeNestedRow (const RefIdColumn *column,
385  RefIdData& data, int index, int rowToRemove) const;
386 
387  virtual void setNestedTable (const RefIdColumn* column,
388  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
389 
390  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
391  const RefIdData& data, int index) const;
392 
393  virtual QVariant getNestedData (const RefIdColumn *column,
394  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
395 
396  virtual void setNestedData (const RefIdColumn *column,
397  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
398 
399  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
400 
401  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
402  };
403 
405  {
408 
410  };
411 
413  template<typename RecordT>
415  {
417 
418  public:
419 
421 
422  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
423  const;
424 
425  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
426  const QVariant& value) const;
428  };
429 
430  template<typename RecordT>
432  const EnchantableColumns& columns)
433  : InventoryRefIdAdapter<RecordT> (type, columns), mEnchantable (columns)
434  {}
435 
436  template<typename RecordT>
438  int index) const
439  {
440  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
442 
443  if (column==mEnchantable.mEnchantment)
444  return QString::fromUtf8 (record.get().mEnchant.c_str());
445 
446  if (column==mEnchantable.mEnchantmentPoints)
447  return static_cast<int> (record.get().mData.mEnchant);
448 
449  return InventoryRefIdAdapter<RecordT>::getData (column, data, index);
450  }
451 
452  template<typename RecordT>
454  int index, const QVariant& value) const
455  {
456  Record<RecordT>& record = static_cast<Record<RecordT>&> (
458 
459  RecordT record2 = record.get();
460  if (column==mEnchantable.mEnchantment)
461  record2.mEnchant = value.toString().toUtf8().constData();
462  else if (column==mEnchantable.mEnchantmentPoints)
463  record2.mData.mEnchant = value.toInt();
464  else
465  {
466  InventoryRefIdAdapter<RecordT>::setData (column, data, index, value);
467  return;
468  }
469 
470  record.setModified(record2);
471  }
472 
474  {
477 
479  };
480 
482  template<typename RecordT>
483  class ToolRefIdAdapter : public InventoryRefIdAdapter<RecordT>
484  {
486 
487  public:
488 
489  ToolRefIdAdapter (UniversalId::Type type, const ToolColumns& columns);
490 
491  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
492  const;
493 
494  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
495  const QVariant& value) const;
497  };
498 
499  template<typename RecordT>
501  : InventoryRefIdAdapter<RecordT> (type, columns), mTools (columns)
502  {}
503 
504  template<typename RecordT>
505  QVariant ToolRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
506  int index) const
507  {
508  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
510 
511  if (column==mTools.mQuality)
512  return record.get().mData.mQuality;
513 
514  if (column==mTools.mUses)
515  return record.get().mData.mUses;
516 
517  return InventoryRefIdAdapter<RecordT>::getData (column, data, index);
518  }
519 
520  template<typename RecordT>
522  int index, const QVariant& value) const
523  {
524  Record<RecordT>& record = static_cast<Record<RecordT>&> (
526 
527  RecordT record2 = record.get();
528  if (column==mTools.mQuality)
529  record2.mData.mQuality = value.toFloat();
530  else if (column==mTools.mUses)
531  record2.mData.mUses = value.toInt();
532  else
533  {
534  InventoryRefIdAdapter<RecordT>::setData (column, data, index, value);
535  return;
536  }
537 
538  record.setModified(record2);
539  }
540 
541  struct ActorColumns : public NameColumns
542  {
551  std::map<const RefIdColumn *, unsigned int> mServices;
552 
553  ActorColumns (const NameColumns& base) : NameColumns (base) {}
554  };
555 
557  template<typename RecordT>
558  class ActorRefIdAdapter : public NameRefIdAdapter<RecordT>
559  {
561 
562  public:
563 
564  ActorRefIdAdapter (UniversalId::Type type, const ActorColumns& columns);
565 
566  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
567  const;
568 
569  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
570  const QVariant& value) const;
572  };
573 
574  template<typename RecordT>
576  const ActorColumns& columns)
577  : NameRefIdAdapter<RecordT> (type, columns), mActors (columns)
578  {}
579 
580  template<typename RecordT>
581  QVariant ActorRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
582  int index) const
583  {
584  const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
586 
587  if (column==mActors.mHello)
588  return record.get().mAiData.mHello;
589 
590  if (column==mActors.mFlee)
591  return record.get().mAiData.mFlee;
592 
593  if (column==mActors.mFight)
594  return record.get().mAiData.mFight;
595 
596  if (column==mActors.mAlarm)
597  return record.get().mAiData.mAlarm;
598 
599  if (column==mActors.mInventory)
600  return QVariant::fromValue(ColumnBase::TableEdit_Full);
601 
602  if (column==mActors.mSpells)
603  return QVariant::fromValue(ColumnBase::TableEdit_Full);
604 
605  if (column==mActors.mDestinations)
606  return QVariant::fromValue(ColumnBase::TableEdit_Full);
607 
608  if (column==mActors.mAiPackages)
609  return QVariant::fromValue(ColumnBase::TableEdit_Full);
610 
611  std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
612  mActors.mServices.find (column);
613 
614  if (iter!=mActors.mServices.end())
615  return (record.get().mAiData.mServices & iter->second)!=0;
616 
617  return NameRefIdAdapter<RecordT>::getData (column, data, index);
618  }
619 
620  template<typename RecordT>
621  void ActorRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
622  const QVariant& value) const
623  {
624  Record<RecordT>& record = static_cast<Record<RecordT>&> (
626 
627  RecordT record2 = record.get();
628  if (column==mActors.mHello)
629  record2.mAiData.mHello = value.toInt();
630  else if (column==mActors.mFlee)
631  record2.mAiData.mFlee = value.toInt();
632  else if (column==mActors.mFight)
633  record2.mAiData.mFight = value.toInt();
634  else if (column==mActors.mAlarm)
635  record2.mAiData.mAlarm = value.toInt();
636  else
637  {
638  typename std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
639  mActors.mServices.find (column);
640  if (iter!=mActors.mServices.end())
641  {
642  if (value.toInt()!=0)
643  record2.mAiData.mServices |= iter->second;
644  else
645  record2.mAiData.mServices &= ~iter->second;
646  }
647  else
648  {
649  NameRefIdAdapter<RecordT>::setData (column, data, index, value);
650  return;
651  }
652  }
653 
654  record.setModified(record2);
655  }
656 
657  class ApparatusRefIdAdapter : public InventoryRefIdAdapter<ESM::Apparatus>
658  {
661 
662  public:
663 
664  ApparatusRefIdAdapter (const InventoryColumns& columns, const RefIdColumn *type,
665  const RefIdColumn *quality);
666 
667  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
668  const;
669 
670  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
671  const QVariant& value) const;
673  };
674 
675  class ArmorRefIdAdapter : public EnchantableRefIdAdapter<ESM::Armor>
676  {
681 
682  public:
683 
684  ArmorRefIdAdapter (const EnchantableColumns& columns, const RefIdColumn *type,
685  const RefIdColumn *health, const RefIdColumn *armor, const RefIdColumn *partRef);
686 
687  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
688  const;
689 
690  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
691  const QVariant& value) const;
693  };
694 
695  class BookRefIdAdapter : public EnchantableRefIdAdapter<ESM::Book>
696  {
700 
701  public:
702 
703  BookRefIdAdapter (const EnchantableColumns& columns, const RefIdColumn *scroll,
704  const RefIdColumn *skill, const RefIdColumn *text);
705 
706  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
707  const;
708 
709  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
710  const QVariant& value) const;
712  };
713 
714  class ClothingRefIdAdapter : public EnchantableRefIdAdapter<ESM::Clothing>
715  {
718 
719  public:
720 
722  const RefIdColumn *type, const RefIdColumn *partRef);
723 
724  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
725  const;
726 
727  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
728  const QVariant& value) const;
730  };
731 
732  class ContainerRefIdAdapter : public NameRefIdAdapter<ESM::Container>
733  {
738 
739  public:
740 
741  ContainerRefIdAdapter (const NameColumns& columns, const RefIdColumn *weight,
742  const RefIdColumn *organic, const RefIdColumn *respawn, const RefIdColumn *content);
743 
744  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index) const;
745 
746  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
747  const QVariant& value) const;
749  };
750 
752  {
753  std::map<const RefIdColumn *, unsigned int> mFlags;
760 
761  CreatureColumns (const ActorColumns& actorColumns);
762  };
763 
764  class CreatureRefIdAdapter : public ActorRefIdAdapter<ESM::Creature>
765  {
767 
768  public:
769 
770  CreatureRefIdAdapter (const CreatureColumns& columns);
771 
772  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
773  const;
774 
775  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
776  const QVariant& value) const;
778  };
779 
780  class DoorRefIdAdapter : public NameRefIdAdapter<ESM::Door>
781  {
784 
785  public:
786 
787  DoorRefIdAdapter (const NameColumns& columns, const RefIdColumn *openSound,
788  const RefIdColumn *closeSound);
789 
790  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
791  const;
792 
793  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
794  const QVariant& value) const;
796  };
797 
799  {
804  std::map<const RefIdColumn *, unsigned int> mFlags;
805 
806  LightColumns (const InventoryColumns& columns);
807  };
808 
809  class LightRefIdAdapter : public InventoryRefIdAdapter<ESM::Light>
810  {
812 
813  public:
814 
815  LightRefIdAdapter (const LightColumns& columns);
816 
817  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
818  const;
819 
820  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
821  const QVariant& value) const;
823  };
824 
825  class MiscRefIdAdapter : public InventoryRefIdAdapter<ESM::Miscellaneous>
826  {
828 
829  public:
830 
831  MiscRefIdAdapter (const InventoryColumns& columns, const RefIdColumn *key);
832 
833  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
834  const;
835 
836  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
837  const QVariant& value) const;
839  };
840 
841  struct NpcColumns : public ActorColumns
842  {
843  std::map<const RefIdColumn *, unsigned int> mFlags;
849  const RefIdColumn *mAttributes; // depends on npc type
850  const RefIdColumn *mSkills; // depends on npc type
851  const RefIdColumn *mMisc; // may depend on npc type, e.g. FactionID
852 
853  NpcColumns (const ActorColumns& actorColumns);
854  };
855 
856  class NpcRefIdAdapter : public ActorRefIdAdapter<ESM::NPC>
857  {
859 
860  public:
861 
862  NpcRefIdAdapter (const NpcColumns& columns);
863 
864  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
865  const;
866 
867  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
868  const QVariant& value) const;
870  };
871 
873  {
878  const RefIdColumn *mChop[2];
879  const RefIdColumn *mSlash[2];
880  const RefIdColumn *mThrust[2];
881  std::map<const RefIdColumn *, unsigned int> mFlags;
882 
883  WeaponColumns (const EnchantableColumns& columns);
884  };
885 
886  class WeaponRefIdAdapter : public EnchantableRefIdAdapter<ESM::Weapon>
887  {
889 
890  public:
891 
892  WeaponRefIdAdapter (const WeaponColumns& columns);
893 
894  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
895  const;
896 
897  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
898  const QVariant& value) const;
900  };
901 
902 
904 
906  {
907  public:
908 
910 
911  virtual void addNestedRow (const RefIdColumn *column,
912  RefIdData& data, int index, int position) const;
913 
914  virtual void removeNestedRow (const RefIdColumn *column,
915  RefIdData& data, int index, int rowToRemove) const;
916 
917  virtual void setNestedTable (const RefIdColumn* column,
918  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
919 
920  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
921  const RefIdData& data, int index) const;
922 
923  virtual QVariant getNestedData (const RefIdColumn *column,
924  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
925 
926  virtual void setNestedData (const RefIdColumn *column,
927  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
928 
929  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
930 
931  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
932  };
933 
935  {
936  public:
937 
939 
940  virtual void addNestedRow (const RefIdColumn *column,
941  RefIdData& data, int index, int position) const;
942 
943  virtual void removeNestedRow (const RefIdColumn *column,
944  RefIdData& data, int index, int rowToRemove) const;
945 
946  virtual void setNestedTable (const RefIdColumn* column,
947  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
948 
949  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
950  const RefIdData& data, int index) const;
951 
952  virtual QVariant getNestedData (const RefIdColumn *column,
953  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
954 
955  virtual void setNestedData (const RefIdColumn *column,
956  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
957 
958  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
959 
960  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
961  };
962 
964  {
967 
968  public:
969 
971  virtual ~NpcMiscRefIdAdapter();
972 
973  virtual void addNestedRow (const RefIdColumn *column,
974  RefIdData& data, int index, int position) const;
975 
976  virtual void removeNestedRow (const RefIdColumn *column,
977  RefIdData& data, int index, int rowToRemove) const;
978 
979  virtual void setNestedTable (const RefIdColumn* column,
980  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
981 
982  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
983  const RefIdData& data, int index) const;
984 
985  virtual QVariant getNestedData (const RefIdColumn *column,
986  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
987 
988  virtual void setNestedData (const RefIdColumn *column,
989  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
990 
991  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
992 
993  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
994  };
995 
997  {
998  public:
999 
1001 
1002  virtual void addNestedRow (const RefIdColumn *column,
1003  RefIdData& data, int index, int position) const;
1004 
1005  virtual void removeNestedRow (const RefIdColumn *column,
1006  RefIdData& data, int index, int rowToRemove) const;
1007 
1008  virtual void setNestedTable (const RefIdColumn* column,
1009  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
1010 
1011  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
1012  const RefIdData& data, int index) const;
1013 
1014  virtual QVariant getNestedData (const RefIdColumn *column,
1015  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
1016 
1017  virtual void setNestedData (const RefIdColumn *column,
1018  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
1019 
1020  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
1021 
1022  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
1023  };
1024 
1026  {
1027  public:
1028 
1030 
1031  virtual void addNestedRow (const RefIdColumn *column,
1032  RefIdData& data, int index, int position) const;
1033 
1034  virtual void removeNestedRow (const RefIdColumn *column,
1035  RefIdData& data, int index, int rowToRemove) const;
1036 
1037  virtual void setNestedTable (const RefIdColumn* column,
1038  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
1039 
1040  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
1041  const RefIdData& data, int index) const;
1042 
1043  virtual QVariant getNestedData (const RefIdColumn *column,
1044  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
1045 
1046  virtual void setNestedData (const RefIdColumn *column,
1047  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
1048 
1049  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
1050 
1051  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
1052  };
1053 
1055  {
1058 
1059  public:
1060 
1062  virtual ~CreatureMiscRefIdAdapter();
1063 
1064  virtual void addNestedRow (const RefIdColumn *column,
1065  RefIdData& data, int index, int position) const;
1066 
1067  virtual void removeNestedRow (const RefIdColumn *column,
1068  RefIdData& data, int index, int rowToRemove) const;
1069 
1070  virtual void setNestedTable (const RefIdColumn* column,
1071  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const;
1072 
1073  virtual NestedTableWrapperBase* nestedTable (const RefIdColumn* column,
1074  const RefIdData& data, int index) const;
1075 
1076  virtual QVariant getNestedData (const RefIdColumn *column,
1077  const RefIdData& data, int index, int subRowIndex, int subColIndex) const;
1078 
1079  virtual void setNestedData (const RefIdColumn *column,
1080  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const;
1081 
1082  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const;
1083 
1084  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const;
1085  };
1086 
1087  template<typename ESXRecordT>
1088  class EffectsListAdapter;
1089 
1090  template<typename ESXRecordT>
1092  {
1094 
1095  // not implemented
1098 
1099  public:
1100 
1102 
1104 
1105  virtual void addNestedRow (const RefIdColumn *column,
1106  RefIdData& data, int index, int position) const
1107  {
1108  Record<ESXRecordT>& record =
1109  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1110  EffectsListAdapter<ESXRecordT>::addRow(record, position);
1111  }
1112 
1113  virtual void removeNestedRow (const RefIdColumn *column,
1114  RefIdData& data, int index, int rowToRemove) const
1115  {
1116  Record<ESXRecordT>& record =
1117  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1118  EffectsListAdapter<ESXRecordT>::removeRow(record, rowToRemove);
1119  }
1120 
1121  virtual void setNestedTable (const RefIdColumn* column,
1122  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1123  {
1124  Record<ESXRecordT>& record =
1125  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1126  EffectsListAdapter<ESXRecordT>::setTable(record, nestedTable);
1127  }
1128 
1130  const RefIdData& data, int index) const
1131  {
1132  const Record<ESXRecordT>& record =
1133  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1135  }
1136 
1137  virtual QVariant getNestedData (const RefIdColumn *column,
1138  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1139  {
1140  const Record<ESXRecordT>& record =
1141  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1142  return EffectsListAdapter<ESXRecordT>::getData(record, subRowIndex, subColIndex);
1143  }
1144 
1145  virtual void setNestedData (const RefIdColumn *column,
1146  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
1147  {
1148  Record<ESXRecordT>& record =
1149  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
1150  EffectsListAdapter<ESXRecordT>::setData(record, value, subRowIndex, subColIndex);
1151  }
1152 
1153  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
1154  {
1155  const Record<ESXRecordT> record; // not used, just a dummy
1157  }
1158 
1159  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
1160  {
1161  const Record<ESXRecordT>& record =
1162  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1164  }
1165  };
1166 
1167  template <typename ESXRecordT>
1169  {
1171 
1172  // not implemented
1175 
1176  public:
1177 
1179 
1181 
1182  virtual void addNestedRow (const RefIdColumn *column,
1183  RefIdData& data, int index, int position) const
1184  {
1185  Record<ESXRecordT>& record =
1186  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1187  ESXRecordT container = record.get();
1188 
1189  std::vector<ESM::ContItem>& list = container.mInventory.mList;
1190 
1191  ESM::ContItem newRow = ESM::ContItem();
1192 
1193  if (position >= (int)list.size())
1194  list.push_back(newRow);
1195  else
1196  list.insert(list.begin()+position, newRow);
1197 
1198  record.setModified (container);
1199  }
1200 
1201  virtual void removeNestedRow (const RefIdColumn *column,
1202  RefIdData& data, int index, int rowToRemove) const
1203  {
1204  Record<ESXRecordT>& record =
1205  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1206  ESXRecordT container = record.get();
1207 
1208  std::vector<ESM::ContItem>& list = container.mInventory.mList;
1209 
1210  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
1211  throw std::runtime_error ("index out of range");
1212 
1213  list.erase (list.begin () + rowToRemove);
1214 
1215  record.setModified (container);
1216  }
1217 
1218  virtual void setNestedTable (const RefIdColumn* column,
1219  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1220  {
1221  Record<ESXRecordT>& record =
1222  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1223  ESXRecordT container = record.get();
1224 
1225  container.mInventory.mList =
1226  static_cast<const NestedTableWrapper<std::vector<typename ESM::ContItem> >&>(nestedTable).mNestedTable;
1227 
1228  record.setModified (container);
1229  }
1230 
1232  const RefIdData& data, int index) const
1233  {
1234  const Record<ESXRecordT>& record =
1235  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1236 
1237  // deleted by dtor of NestedTableStoring
1238  return new NestedTableWrapper<std::vector<typename ESM::ContItem> >(record.get().mInventory.mList);
1239  }
1240 
1241  virtual QVariant getNestedData (const RefIdColumn *column,
1242  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1243  {
1244  const Record<ESXRecordT>& record =
1245  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1246 
1247  const std::vector<ESM::ContItem>& list = record.get().mInventory.mList;
1248 
1249  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1250  throw std::runtime_error ("index out of range");
1251 
1252  const ESM::ContItem& content = list.at(subRowIndex);
1253 
1254  switch (subColIndex)
1255  {
1256  case 0: return QString::fromUtf8(content.mItem.toString().c_str());
1257  case 1: return content.mCount;
1258  default:
1259  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1260  }
1261  }
1262 
1263  virtual void setNestedData (const RefIdColumn *column,
1264  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
1265  {
1266  Record<ESXRecordT>& record =
1267  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
1268  ESXRecordT container = record.get();
1269  std::vector<ESM::ContItem>& list = container.mInventory.mList;
1270 
1271  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1272  throw std::runtime_error ("index out of range");
1273 
1274  switch(subColIndex)
1275  {
1276  case 0:
1277  list.at(subRowIndex).mItem.assign(std::string(value.toString().toUtf8().constData()));
1278  break;
1279 
1280  case 1:
1281  list.at(subRowIndex).mCount = value.toInt();
1282  break;
1283 
1284  default:
1285  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1286  }
1287 
1288  record.setModified (container);
1289  }
1290 
1291  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
1292  {
1293  return 2;
1294  }
1295 
1296  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
1297  {
1298  const Record<ESXRecordT>& record =
1299  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1300 
1301  return static_cast<int>(record.get().mInventory.mList.size());
1302  }
1303  };
1304 
1305  template <typename ESXRecordT>
1307  {
1309 
1310  // not implemented
1313 
1314  public:
1315 
1317 
1319 
1320  virtual void addNestedRow (const RefIdColumn *column,
1321  RefIdData& data, int index, int position) const
1322  {
1323  Record<ESXRecordT>& record =
1324  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1325  ESXRecordT caster = record.get();
1326 
1327  std::vector<std::string>& list = caster.mSpells.mList;
1328 
1329  std::string newString;
1330 
1331  if (position >= (int)list.size())
1332  list.push_back(newString);
1333  else
1334  list.insert(list.begin()+position, newString);
1335 
1336  record.setModified (caster);
1337  }
1338 
1339  virtual void removeNestedRow (const RefIdColumn *column,
1340  RefIdData& data, int index, int rowToRemove) const
1341  {
1342  Record<ESXRecordT>& record =
1343  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1344  ESXRecordT caster = record.get();
1345 
1346  std::vector<std::string>& list = caster.mSpells.mList;
1347 
1348  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
1349  throw std::runtime_error ("index out of range");
1350 
1351  list.erase (list.begin () + rowToRemove);
1352 
1353  record.setModified (caster);
1354  }
1355 
1356  virtual void setNestedTable (const RefIdColumn* column,
1357  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1358  {
1359  Record<ESXRecordT>& record =
1360  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1361  ESXRecordT caster = record.get();
1362 
1363  caster.mSpells.mList =
1364  static_cast<const NestedTableWrapper<std::vector<typename std::string> >&>(nestedTable).mNestedTable;
1365 
1366  record.setModified (caster);
1367  }
1368 
1370  const RefIdData& data, int index) const
1371  {
1372  const Record<ESXRecordT>& record =
1373  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1374 
1375  // deleted by dtor of NestedTableStoring
1376  return new NestedTableWrapper<std::vector<typename std::string> >(record.get().mSpells.mList);
1377  }
1378 
1379  virtual QVariant getNestedData (const RefIdColumn *column,
1380  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1381  {
1382  const Record<ESXRecordT>& record =
1383  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1384 
1385  const std::vector<std::string>& list = record.get().mSpells.mList;
1386 
1387  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1388  throw std::runtime_error ("index out of range");
1389 
1390  const std::string& content = list.at(subRowIndex);
1391 
1392  if (subColIndex == 0)
1393  return QString::fromUtf8(content.c_str());
1394  else
1395  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1396  }
1397 
1398  virtual void setNestedData (const RefIdColumn *column,
1399  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
1400  {
1401  Record<ESXRecordT>& record =
1402  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
1403  ESXRecordT caster = record.get();
1404  std::vector<std::string>& list = caster.mSpells.mList;
1405 
1406  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1407  throw std::runtime_error ("index out of range");
1408 
1409  if (subColIndex == 0)
1410  list.at(subRowIndex) = std::string(value.toString().toUtf8());
1411  else
1412  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1413 
1414  record.setModified (caster);
1415  }
1416 
1417  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
1418  {
1419  return 1;
1420  }
1421 
1422  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
1423  {
1424  const Record<ESXRecordT>& record =
1425  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1426 
1427  return static_cast<int>(record.get().mSpells.mList.size());
1428  }
1429  };
1430 
1431  template <typename ESXRecordT>
1433  {
1435 
1436  // not implemented
1439 
1440  public:
1441 
1443 
1445 
1446  virtual void addNestedRow (const RefIdColumn *column,
1447  RefIdData& data, int index, int position) const
1448  {
1449  Record<ESXRecordT>& record =
1450  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1451  ESXRecordT traveller = record.get();
1452 
1453  std::vector<ESM::Transport::Dest>& list = traveller.mTransport.mList;
1454 
1455  ESM::Position newPos;
1456  for (unsigned i = 0; i < 3; ++i)
1457  {
1458  newPos.pos[i] = 0;
1459  newPos.rot[i] = 0;
1460  }
1461 
1462  ESM::Transport::Dest newRow;
1463  newRow.mPos = newPos;
1464  newRow.mCellName = "";
1465 
1466  if (position >= (int)list.size())
1467  list.push_back(newRow);
1468  else
1469  list.insert(list.begin()+position, newRow);
1470 
1471  record.setModified (traveller);
1472  }
1473 
1474  virtual void removeNestedRow (const RefIdColumn *column,
1475  RefIdData& data, int index, int rowToRemove) const
1476  {
1477  Record<ESXRecordT>& record =
1478  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1479  ESXRecordT traveller = record.get();
1480 
1481  std::vector<ESM::Transport::Dest>& list = traveller.mTransport.mList;
1482 
1483  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
1484  throw std::runtime_error ("index out of range");
1485 
1486  list.erase (list.begin () + rowToRemove);
1487 
1488  record.setModified (traveller);
1489  }
1490 
1491  virtual void setNestedTable (const RefIdColumn* column,
1492  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1493  {
1494  Record<ESXRecordT>& record =
1495  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1496  ESXRecordT traveller = record.get();
1497 
1498  traveller.mTransport.mList =
1500 
1501  record.setModified (traveller);
1502  }
1503 
1505  const RefIdData& data, int index) const
1506  {
1507  const Record<ESXRecordT>& record =
1508  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1509 
1510  // deleted by dtor of NestedTableStoring
1511  return new NestedTableWrapper<std::vector<typename ESM::Transport::Dest> >(record.get().mTransport.mList);
1512  }
1513 
1514  virtual QVariant getNestedData (const RefIdColumn *column,
1515  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1516  {
1517  const Record<ESXRecordT>& record =
1518  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1519 
1520  const std::vector<ESM::Transport::Dest>& list = record.get().mTransport.mList;
1521 
1522  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1523  throw std::runtime_error ("index out of range");
1524 
1525  const ESM::Transport::Dest& content = list.at(subRowIndex);
1526 
1527  switch (subColIndex)
1528  {
1529  case 0: return QString::fromUtf8(content.mCellName.c_str());
1530  case 1: return content.mPos.pos[0];
1531  case 2: return content.mPos.pos[1];
1532  case 3: return content.mPos.pos[2];
1533  case 4: return content.mPos.rot[0];
1534  case 5: return content.mPos.rot[1];
1535  case 6: return content.mPos.rot[2];
1536  default:
1537  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1538  }
1539  }
1540 
1541  virtual void setNestedData (const RefIdColumn *column,
1542  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
1543  {
1544  Record<ESXRecordT>& record =
1545  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
1546  ESXRecordT traveller = record.get();
1547  std::vector<ESM::Transport::Dest>& list = traveller.mTransport.mList;
1548 
1549  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1550  throw std::runtime_error ("index out of range");
1551 
1552  switch(subColIndex)
1553  {
1554  case 0: list.at(subRowIndex).mCellName = std::string(value.toString().toUtf8().constData()); break;
1555  case 1: list.at(subRowIndex).mPos.pos[0] = value.toFloat(); break;
1556  case 2: list.at(subRowIndex).mPos.pos[1] = value.toFloat(); break;
1557  case 3: list.at(subRowIndex).mPos.pos[2] = value.toFloat(); break;
1558  case 4: list.at(subRowIndex).mPos.rot[0] = value.toFloat(); break;
1559  case 5: list.at(subRowIndex).mPos.rot[1] = value.toFloat(); break;
1560  case 6: list.at(subRowIndex).mPos.rot[2] = value.toFloat(); break;
1561  default:
1562  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1563  }
1564 
1565  record.setModified (traveller);
1566  }
1567 
1568  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
1569  {
1570  return 7;
1571  }
1572 
1573  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
1574  {
1575  const Record<ESXRecordT>& record =
1576  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1577 
1578  return static_cast<int>(record.get().mTransport.mList.size());
1579  }
1580  };
1581 
1582  template <typename ESXRecordT>
1584  {
1586 
1587  // not implemented
1590 
1591  public:
1592 
1594 
1596 
1597  // FIXME: should check if the AI package type is already in the list and use a default
1598  // that wasn't used already (in extreme case do not add anything at all?
1599  virtual void addNestedRow (const RefIdColumn *column,
1600  RefIdData& data, int index, int position) const
1601  {
1602  Record<ESXRecordT>& record =
1603  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1604  ESXRecordT actor = record.get();
1605 
1606  std::vector<ESM::AIPackage>& list = actor.mAiPackage.mList;
1607 
1608  ESM::AIPackage newRow;
1609  newRow.mType = ESM::AI_Wander;
1610  newRow.mWander.mDistance = 0;
1611  newRow.mWander.mDuration = 0;
1612  newRow.mWander.mTimeOfDay = 0;
1613  for (int i = 0; i < 8; ++i)
1614  newRow.mWander.mIdle[i] = 0;
1615  newRow.mWander.mShouldRepeat = 0;
1616  newRow.mCellName = "";
1617 
1618  if (position >= (int)list.size())
1619  list.push_back(newRow);
1620  else
1621  list.insert(list.begin()+position, newRow);
1622 
1623  record.setModified (actor);
1624  }
1625 
1626  virtual void removeNestedRow (const RefIdColumn *column,
1627  RefIdData& data, int index, int rowToRemove) const
1628  {
1629  Record<ESXRecordT>& record =
1630  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1631  ESXRecordT actor = record.get();
1632 
1633  std::vector<ESM::AIPackage>& list = actor.mAiPackage.mList;
1634 
1635  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
1636  throw std::runtime_error ("index out of range");
1637 
1638  list.erase (list.begin () + rowToRemove);
1639 
1640  record.setModified (actor);
1641  }
1642 
1643  virtual void setNestedTable (const RefIdColumn* column,
1644  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1645  {
1646  Record<ESXRecordT>& record =
1647  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1648  ESXRecordT actor = record.get();
1649 
1650  actor.mAiPackage.mList =
1651  static_cast<const NestedTableWrapper<std::vector<typename ESM::AIPackage> >&>(nestedTable).mNestedTable;
1652 
1653  record.setModified (actor);
1654  }
1655 
1657  const RefIdData& data, int index) const
1658  {
1659  const Record<ESXRecordT>& record =
1660  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1661 
1662  // deleted by dtor of NestedTableStoring
1663  return new NestedTableWrapper<std::vector<typename ESM::AIPackage> >(record.get().mAiPackage.mList);
1664  }
1665 
1666  virtual QVariant getNestedData (const RefIdColumn *column,
1667  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1668  {
1669  const Record<ESXRecordT>& record =
1670  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1671 
1672  const std::vector<ESM::AIPackage>& list = record.get().mAiPackage.mList;
1673 
1674  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1675  throw std::runtime_error ("index out of range");
1676 
1677  const ESM::AIPackage& content = list.at(subRowIndex);
1678 
1679  switch (subColIndex)
1680  {
1681  case 0:
1682  // FIXME: should more than one AI package type be allowed? Check vanilla
1683  switch (content.mType)
1684  {
1685  case ESM::AI_Wander: return 0;
1686  case ESM::AI_Travel: return 1;
1687  case ESM::AI_Follow: return 2;
1688  case ESM::AI_Escort: return 3;
1689  case ESM::AI_Activate: return 4;
1690  case ESM::AI_CNDT:
1691  default: return QVariant();
1692  }
1693  case 1: // wander dist
1694  if (content.mType == ESM::AI_Wander)
1695  return content.mWander.mDistance;
1696  else
1697  return QVariant();
1698  case 2: // wander dur
1699  if (content.mType == ESM::AI_Wander ||
1700  content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1701  return content.mWander.mDuration;
1702  else
1703  return QVariant();
1704  case 3: // wander ToD
1705  if (content.mType == ESM::AI_Wander)
1706  return content.mWander.mTimeOfDay; // FIXME: not sure of the format
1707  else
1708  return QVariant();
1709  case 4: // wander idle
1710  case 5:
1711  case 6:
1712  case 7:
1713  case 8:
1714  case 9:
1715  case 10:
1716  case 11:
1717  if (content.mType == ESM::AI_Wander)
1718  return static_cast<int>(content.mWander.mIdle[subColIndex-4]);
1719  else
1720  return QVariant();
1721  case 12: // wander repeat
1722  if (content.mType == ESM::AI_Wander)
1723  return content.mWander.mShouldRepeat != 0;
1724  else
1725  return QVariant();
1726  case 13: // activate name
1727  if (content.mType == ESM::AI_Activate)
1728  return QString(content.mActivate.mName.toString().c_str());
1729  else
1730  return QVariant();
1731  case 14: // target id
1732  if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1733  return QString(content.mTarget.mId.toString().c_str());
1734  else
1735  return QVariant();
1736  case 15: // target cell
1737  if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1738  return QString::fromUtf8(content.mCellName.c_str());
1739  else
1740  return QVariant();
1741  case 16:
1742  if (content.mType == ESM::AI_Travel)
1743  return content.mTravel.mX;
1744  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1745  return content.mTarget.mX;
1746  else
1747  return QVariant();
1748  case 17:
1749  if (content.mType == ESM::AI_Travel)
1750  return content.mTravel.mY;
1751  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1752  return content.mTarget.mY;
1753  else
1754  return QVariant();
1755  case 18:
1756  if (content.mType == ESM::AI_Travel)
1757  return content.mTravel.mZ;
1758  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1759  return content.mTarget.mZ;
1760  else
1761  return QVariant();
1762  default:
1763  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1764  }
1765  }
1766 
1767  virtual void setNestedData (const RefIdColumn *column,
1768  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
1769  {
1770  Record<ESXRecordT>& record =
1771  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
1772  ESXRecordT actor = record.get();
1773  std::vector<ESM::AIPackage>& list = actor.mAiPackage.mList;
1774 
1775  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1776  throw std::runtime_error ("index out of range");
1777 
1778  ESM::AIPackage& content = list.at(subRowIndex);
1779 
1780  switch(subColIndex)
1781  {
1782  case 0: // ai package type
1783  switch (value.toInt())
1784  {
1785  case 0: content.mType = ESM::AI_Wander; break;
1786  case 1: content.mType = ESM::AI_Travel; break;
1787  case 2: content.mType = ESM::AI_Follow; break;
1788  case 3: content.mType = ESM::AI_Escort; break;
1789  case 4: content.mType = ESM::AI_Activate; break;
1790  default: return; // return without saving
1791  }
1792  break; // always save
1793 
1794  case 1:
1795  if (content.mType == ESM::AI_Wander)
1796  content.mWander.mDistance = static_cast<short>(value.toInt());
1797  else
1798  return; // return without saving
1799 
1800  break; // always save
1801  case 2:
1802  if (content.mType == ESM::AI_Wander ||
1803  content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1804  content.mWander.mDuration = static_cast<short>(value.toInt());
1805  else
1806  return; // return without saving
1807  case 3:
1808  if (content.mType == ESM::AI_Wander)
1809  content.mWander.mTimeOfDay = static_cast<unsigned char>(value.toInt());
1810  else
1811  return; // return without saving
1812 
1813  break; // always save
1814  case 4:
1815  case 5:
1816  case 6:
1817  case 7:
1818  case 8:
1819  case 9:
1820  case 10:
1821  case 11:
1822  if (content.mType == ESM::AI_Wander)
1823  content.mWander.mIdle[subColIndex-4] = static_cast<unsigned char>(value.toInt());
1824  else
1825  return; // return without saving
1826 
1827  break; // always save
1828  case 12:
1829  if (content.mType == ESM::AI_Wander)
1830  content.mWander.mShouldRepeat = static_cast<unsigned char>(value.toInt());
1831  else
1832  return; // return without saving
1833 
1834  break; // always save
1835  case 13: // NAME32
1836  if (content.mType == ESM::AI_Activate)
1837  content.mActivate.mName.assign(value.toString().toUtf8().constData());
1838  else
1839  return; // return without saving
1840 
1841  break; // always save
1842  case 14: // NAME32
1843  if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1844  content.mTarget.mId.assign(value.toString().toUtf8().constData());
1845  else
1846  return; // return without saving
1847 
1848  break; // always save
1849  case 15:
1850  if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1851  content.mCellName = std::string(value.toString().toUtf8().constData());
1852  else
1853  return; // return without saving
1854 
1855  break; // always save
1856  case 16:
1857  if (content.mType == ESM::AI_Travel)
1858  content.mTravel.mZ = value.toFloat();
1859  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1860  content.mTarget.mZ = value.toFloat();
1861  else
1862  return; // return without saving
1863 
1864  break; // always save
1865  case 17:
1866  if (content.mType == ESM::AI_Travel)
1867  content.mTravel.mZ = value.toFloat();
1868  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1869  content.mTarget.mZ = value.toFloat();
1870  else
1871  return; // return without saving
1872 
1873  break; // always save
1874  case 18:
1875  if (content.mType == ESM::AI_Travel)
1876  content.mTravel.mZ = value.toFloat();
1877  else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
1878  content.mTarget.mZ = value.toFloat();
1879  else
1880  return; // return without saving
1881 
1882  break; // always save
1883  default:
1884  throw std::runtime_error("Trying to access non-existing column in the nested table!");
1885  }
1886 
1887  record.setModified (actor);
1888  }
1889 
1890  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
1891  {
1892  return 19;
1893  }
1894 
1895  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
1896  {
1897  const Record<ESXRecordT>& record =
1898  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1899 
1900  return static_cast<int>(record.get().mAiPackage.mList.size());
1901  }
1902  };
1903 
1904 
1905  template <typename ESXRecordT>
1907  {
1909 
1910  // not implemented
1913 
1914  public:
1915 
1917 
1919 
1920  virtual void addNestedRow (const RefIdColumn *column,
1921  RefIdData& data, int index, int position) const
1922  {
1923  Record<ESXRecordT>& record =
1924  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1925  ESXRecordT apparel = record.get();
1926 
1927  std::vector<ESM::PartReference>& list = apparel.mParts.mParts;
1928 
1929  ESM::PartReference newPart;
1930  newPart.mPart = 0; // 0 == head
1931  newPart.mMale = "";
1932  newPart.mFemale = "";
1933 
1934  if (position >= (int)list.size())
1935  list.push_back(newPart);
1936  else
1937  list.insert(list.begin()+position, newPart);
1938 
1939  record.setModified (apparel);
1940  }
1941 
1942  virtual void removeNestedRow (const RefIdColumn *column,
1943  RefIdData& data, int index, int rowToRemove) const
1944  {
1945  Record<ESXRecordT>& record =
1946  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1947  ESXRecordT apparel = record.get();
1948 
1949  std::vector<ESM::PartReference>& list = apparel.mParts.mParts;
1950 
1951  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
1952  throw std::runtime_error ("index out of range");
1953 
1954  list.erase (list.begin () + rowToRemove);
1955 
1956  record.setModified (apparel);
1957  }
1958 
1959  virtual void setNestedTable (const RefIdColumn* column,
1960  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
1961  {
1962  Record<ESXRecordT>& record =
1963  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1964  ESXRecordT apparel = record.get();
1965 
1966  apparel.mParts.mParts =
1968 
1969  record.setModified (apparel);
1970  }
1971 
1973  const RefIdData& data, int index) const
1974  {
1975  const Record<ESXRecordT>& record =
1976  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1977 
1978  // deleted by dtor of NestedTableStoring
1979  return new NestedTableWrapper<std::vector<typename ESM::PartReference> >(record.get().mParts.mParts);
1980  }
1981 
1982  virtual QVariant getNestedData (const RefIdColumn *column,
1983  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
1984  {
1985  const Record<ESXRecordT>& record =
1986  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
1987 
1988  const std::vector<ESM::PartReference>& list = record.get().mParts.mParts;
1989 
1990  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
1991  throw std::runtime_error ("index out of range");
1992 
1993  const ESM::PartReference& content = list.at(subRowIndex);
1994 
1995  switch (subColIndex)
1996  {
1997  case 0:
1998  {
1999  if (content.mPart < ESM::PRT_Count)
2000  return content.mPart;
2001  else
2002  throw std::runtime_error("Part Reference Type unexpected value");
2003  }
2004  case 1: return QString(content.mMale.c_str());
2005  case 2: return QString(content.mFemale.c_str());
2006  default:
2007  throw std::runtime_error("Trying to access non-existing column in the nested table!");
2008  }
2009  }
2010 
2011  virtual void setNestedData (const RefIdColumn *column,
2012  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
2013  {
2014  Record<ESXRecordT>& record =
2015  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
2016  ESXRecordT apparel = record.get();
2017  std::vector<ESM::PartReference>& list = apparel.mParts.mParts;
2018 
2019  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
2020  throw std::runtime_error ("index out of range");
2021 
2022  switch(subColIndex)
2023  {
2024  case 0: list.at(subRowIndex).mPart = static_cast<unsigned char>(value.toInt()); break;
2025  case 1: list.at(subRowIndex).mMale = value.toString().toStdString(); break;
2026  case 2: list.at(subRowIndex).mFemale = value.toString().toStdString(); break;
2027  default:
2028  throw std::runtime_error("Trying to access non-existing column in the nested table!");
2029  }
2030 
2031  record.setModified (apparel);
2032  }
2033 
2034  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
2035  {
2036  return 3;
2037  }
2038 
2039  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
2040  {
2041  const Record<ESXRecordT>& record =
2042  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2043 
2044  return static_cast<int>(record.get().mParts.mParts.size());
2045  }
2046  };
2047 
2048 
2049  struct LevListColumns : public BaseColumns
2050  {
2053 
2054  LevListColumns (const BaseColumns& base) : BaseColumns (base) {}
2055  };
2056 
2057  template<typename RecordT>
2059  {
2061 
2062  public:
2063 
2065 
2066  virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int index)
2067  const;
2068 
2069  virtual void setData (const RefIdColumn *column, RefIdData& data, int index,
2070  const QVariant& value) const;
2072  };
2073 
2074  template<typename RecordT>
2076  const LevListColumns &columns)
2077  : BaseRefIdAdapter<RecordT> (type, columns), mLevList (columns)
2078  {}
2079 
2080  template<typename RecordT>
2082  int index) const
2083  {
2084  if (column==mLevList.mLevList || column == mLevList.mNestedListLevList)
2085  return QVariant::fromValue(ColumnBase::TableEdit_Full);
2086 
2087  return BaseRefIdAdapter<RecordT>::getData (column, data, index);
2088  }
2089 
2090  template<typename RecordT>
2092  const QVariant& value) const
2093  {
2094  BaseRefIdAdapter<RecordT>::setData (column, data, index, value);
2095  return;
2096  }
2097 
2098 
2099  // for non-tables
2100  template <typename ESXRecordT>
2102  {
2104 
2105  // not implemented
2108 
2109  public:
2110 
2112  :mType(type) {}
2113 
2115 
2116  virtual void addNestedRow (const RefIdColumn *column,
2117  RefIdData& data, int index, int position) const
2118  {
2119  throw std::logic_error ("cannot add a row to a fixed table");
2120  }
2121 
2122  virtual void removeNestedRow (const RefIdColumn *column,
2123  RefIdData& data, int index, int rowToRemove) const
2124  {
2125  throw std::logic_error ("cannot remove a row to a fixed table");
2126  }
2127 
2128  virtual void setNestedTable (const RefIdColumn* column,
2129  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
2130  {
2131  throw std::logic_error ("table operation not supported");
2132  }
2133 
2135  const RefIdData& data, int index) const
2136  {
2137  throw std::logic_error ("table operation not supported");
2138  }
2139 
2140  virtual QVariant getNestedData (const RefIdColumn *column,
2141  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
2142  {
2143  const Record<ESXRecordT>& record =
2144  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2145 
2147  {
2148  switch (subColIndex)
2149  {
2150  case 0: return QVariant(); // disable the checkbox editor
2151  case 1: return record.get().mFlags & ESM::CreatureLevList::AllLevels;
2152  case 2: return static_cast<int> (record.get().mChanceNone);
2153  default:
2154  throw std::runtime_error("Trying to access non-existing column in levelled creatues!");
2155  }
2156  }
2157  else
2158  {
2159  switch (subColIndex)
2160  {
2161  case 0: return record.get().mFlags & ESM::ItemLevList::Each;
2162  case 1: return record.get().mFlags & ESM::ItemLevList::AllLevels;
2163  case 2: return static_cast<int> (record.get().mChanceNone);
2164  default:
2165  throw std::runtime_error("Trying to access non-existing column in levelled items!");
2166  }
2167  }
2168  }
2169 
2170  virtual void setNestedData (const RefIdColumn *column,
2171  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
2172  {
2173  Record<ESXRecordT>& record =
2174  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
2175  ESXRecordT leveled = record.get();
2176 
2178  {
2179  switch(subColIndex)
2180  {
2181  case 0: return; // return without saving
2182  case 1:
2183  {
2184  if(value.toBool())
2185  {
2186  leveled.mFlags |= ESM::CreatureLevList::AllLevels;
2187  break;
2188  }
2189  else
2190  {
2191  leveled.mFlags &= ~ESM::CreatureLevList::AllLevels;
2192  break;
2193  }
2194  }
2195  case 2: leveled.mChanceNone = static_cast<unsigned char>(value.toInt()); break;
2196  default:
2197  throw std::runtime_error("Trying to set non-existing column in levelled creatures!");
2198  }
2199  }
2200  else
2201  {
2202  switch(subColIndex)
2203  {
2204  case 0:
2205  {
2206  if(value.toBool())
2207  {
2208  leveled.mFlags |= ESM::ItemLevList::Each;
2209  break;
2210  }
2211  else
2212  {
2213  leveled.mFlags &= ~ESM::ItemLevList::Each;
2214  break;
2215  }
2216  }
2217  case 1:
2218  {
2219  if(value.toBool())
2220  {
2221  leveled.mFlags |= ESM::ItemLevList::AllLevels;
2222  break;
2223  }
2224  else
2225  {
2226  leveled.mFlags &= ~ESM::ItemLevList::AllLevels;
2227  break;
2228  }
2229  }
2230  case 2: leveled.mChanceNone = static_cast<unsigned char>(value.toInt()); break;
2231  default:
2232  throw std::runtime_error("Trying to set non-existing column in levelled items!");
2233  }
2234  }
2235 
2236  record.setModified (leveled);
2237  }
2238 
2239  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
2240  {
2241  return 3;
2242  }
2243 
2244  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
2245  {
2246  return 1; // fixed at size 1
2247  }
2248  };
2249 
2250  // for tables
2251  template <typename ESXRecordT>
2253  {
2255 
2256  // not implemented
2259 
2260  public:
2261 
2263 
2265 
2266  virtual void addNestedRow (const RefIdColumn *column,
2267  RefIdData& data, int index, int position) const
2268  {
2269  Record<ESXRecordT>& record =
2270  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2271  ESXRecordT leveled = record.get();
2272 
2273  std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList;
2274 
2276  newItem.mId = "";
2277  newItem.mLevel = 0;
2278 
2279  if (position >= (int)list.size())
2280  list.push_back(newItem);
2281  else
2282  list.insert(list.begin()+position, newItem);
2283 
2284  record.setModified (leveled);
2285  }
2286 
2287  virtual void removeNestedRow (const RefIdColumn *column,
2288  RefIdData& data, int index, int rowToRemove) const
2289  {
2290  Record<ESXRecordT>& record =
2291  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2292  ESXRecordT leveled = record.get();
2293 
2294  std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList;
2295 
2296  if (rowToRemove < 0 || rowToRemove >= static_cast<int> (list.size()))
2297  throw std::runtime_error ("index out of range");
2298 
2299  list.erase (list.begin () + rowToRemove);
2300 
2301  record.setModified (leveled);
2302  }
2303 
2304  virtual void setNestedTable (const RefIdColumn* column,
2305  RefIdData& data, int index, const NestedTableWrapperBase& nestedTable) const
2306  {
2307  Record<ESXRecordT>& record =
2308  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2309  ESXRecordT leveled = record.get();
2310 
2311  leveled.mList =
2313 
2314  record.setModified (leveled);
2315  }
2316 
2318  const RefIdData& data, int index) const
2319  {
2320  const Record<ESXRecordT>& record =
2321  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2322 
2323  // deleted by dtor of NestedTableStoring
2325  }
2326 
2327  virtual QVariant getNestedData (const RefIdColumn *column,
2328  const RefIdData& data, int index, int subRowIndex, int subColIndex) const
2329  {
2330  const Record<ESXRecordT>& record =
2331  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2332 
2333  const std::vector<ESM::LevelledListBase::LevelItem>& list = record.get().mList;
2334 
2335  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
2336  throw std::runtime_error ("index out of range");
2337 
2338  const ESM::LevelledListBase::LevelItem& content = list.at(subRowIndex);
2339 
2340  switch (subColIndex)
2341  {
2342  case 0: return QString(content.mId.c_str());
2343  case 1: return content.mLevel;
2344  default:
2345  throw std::runtime_error("Trying to access non-existing column in the nested table!");
2346  }
2347  }
2348 
2349  virtual void setNestedData (const RefIdColumn *column,
2350  RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const
2351  {
2352  Record<ESXRecordT>& record =
2353  static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
2354  ESXRecordT leveled = record.get();
2355  std::vector<ESM::LevelledListBase::LevelItem>& list = leveled.mList;
2356 
2357  if (subRowIndex < 0 || subRowIndex >= static_cast<int> (list.size()))
2358  throw std::runtime_error ("index out of range");
2359 
2360  switch(subColIndex)
2361  {
2362  case 0: list.at(subRowIndex).mId = value.toString().toStdString(); break;
2363  case 1: list.at(subRowIndex).mLevel = static_cast<short>(value.toInt()); break;
2364  default:
2365  throw std::runtime_error("Trying to access non-existing column in the nested table!");
2366  }
2367 
2368  record.setModified (leveled);
2369  }
2370 
2371  virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
2372  {
2373  return 2;
2374  }
2375 
2376  virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const
2377  {
2378  const Record<ESXRecordT>& record =
2379  static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
2380 
2381  return static_cast<int>(record.get().mList.size());
2382  }
2383  };
2384 }
2385 
2386 #endif
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:229
NpcMiscRefIdAdapter & operator=(const NpcMiscRefIdAdapter &)
const RefIdColumn * mType
Definition: refidadapterimp.hpp:677
virtual ~NestedListLevListRefIdAdapter()
Definition: refidadapterimp.hpp:2114
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:453
Definition: aipackage.hpp:66
const RefIdColumn * mHealth
Definition: refidadapterimp.hpp:678
const RefIdColumn * mThrust[2]
Definition: refidadapterimp.hpp:880
const RefIdColumn * mArmor
Definition: refidadapterimp.hpp:679
ModelColumns mModel
Definition: refidadapterimp.hpp:126
Definition: nestedtablewrapper.hpp:6
Adapter for IDs with names (all but levelled lists and statics)
Definition: refidadapterimp.hpp:187
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1201
InventoryRefIdAdapter(UniversalId::Type type, const InventoryColumns &columns)
Definition: refidadapterimp.hpp:273
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:279
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:559
const RefIdColumn * mPartRef
Definition: refidadapterimp.hpp:680
const RefIdColumn * mNestedListLevList
Definition: refidadapterimp.hpp:2052
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:1002
NestedListLevListRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:2111
EnchantableRefIdAdapter(UniversalId::Type type, const EnchantableColumns &columns)
Definition: refidadapterimp.hpp:431
Definition: loadarmo.hpp:47
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:309
std::string mId
Definition: loadlevlist.hpp:33
Definition: refidadapterimp.hpp:872
Definition: refidadapterimp.hpp:23
IngredientRefIdAdapter(const IngredientColumns &columns)
Definition: refidadapterimp.cpp:61
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:706
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:2327
NestedTravelRefIdAdapter & operator=(const NestedTravelRefIdAdapter &)
const RefIdColumn * mDestinations
Definition: refidadapterimp.hpp:549
std::string mMale
Definition: loadarmo.hpp:50
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1218
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:544
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:225
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:2239
CreatureAttributesRefIdAdapter()
Definition: refidadapterimp.cpp:1113
virtual ~NestedLevListRefIdAdapter()
Definition: refidadapterimp.hpp:2264
virtual ~NestedSpellRefIdAdapter()
Definition: refidadapterimp.hpp:1318
UniversalId::Type mType
Definition: refidadapterimp.hpp:1585
State mState
Definition: record.hpp:19
ModelRefIdAdapter(UniversalId::Type type, const ModelColumns &columns)
Definition: refidadapterimp.hpp:141
const RefIdColumn * mType
Definition: refidadapterimp.hpp:716
float pos[3]
Definition: defs.hpp:40
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:658
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1105
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:2122
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:1568
PotionColumns mColumns
Definition: refidadapterimp.hpp:329
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:615
Definition: nestedcoladapterimp.hpp:229
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:468
AIWander mWander
Definition: aipackage.hpp:79
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:116
Definition: loadcont.hpp:19
const RefIdColumn * mAlarm
Definition: refidadapterimp.hpp:546
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:795
std::string mCellName
Definition: transport.hpp:22
AITarget mTarget
Definition: aipackage.hpp:81
std::string mCellName
Definition: aipackage.hpp:87
const RefIdColumn * mInventory
Definition: refidadapterimp.hpp:547
Definition: refidadapterimp.hpp:351
int mCount
Definition: loadcont.hpp:21
NestedLevListRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:2262
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1895
virtual std::string getId(const RecordBase &record) const
Definition: refidadapterimp.hpp:68
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:501
const RefIdColumn * mColor
Definition: refidadapterimp.hpp:802
short mDuration
Definition: aipackage.hpp:32
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1446
NAME32 mItem
Definition: loadcont.hpp:22
NpcColumns mColumns
Definition: refidadapterimp.hpp:858
Definition: refidadapterimp.hpp:934
EffectsRefIdAdapter(const EffectsRefIdAdapter &)
Definition: transport.hpp:19
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1280
const RefIdColumn * mSound
Definition: refidadapterimp.hpp:803
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:2140
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:2244
NestedListLevListRefIdAdapter & operator=(const NestedListLevListRefIdAdapter &)
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1108
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1474
Definition: refidadapterimp.hpp:825
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:2349
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1261
Definition: refidadapterimp.hpp:996
unsigned char mPart
Definition: loadarmo.hpp:49
Type
Definition: universalid.hpp:40
Adapter for IDs with models (all but levelled lists)
Definition: refidadapterimp.hpp:124
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:103
const RefIdColumn * mWeight
Definition: refidadapterimp.hpp:248
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:1228
const RefIdColumn * mType
Definition: refidadapterimp.hpp:659
const RefIdColumn * mScale
Definition: refidadapterimp.hpp:755
Definition: aipackage.hpp:63
Definition: refiddata.hpp:219
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:74
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1491
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:1298
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:621
NpcRefIdAdapter(const NpcColumns &columns)
Definition: refidadapterimp.cpp:702
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:1327
const RefIdColumn * mPartRef
Definition: refidadapterimp.hpp:717
int list(Bsa::BSAFile &bsa, Arguments &info)
Definition: bsatool.cpp:183
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:960
const RefIdColumn * mScript
Definition: refidadapterimp.hpp:180
std::map< const RefIdColumn *, unsigned int > mFlags
Definition: refidadapterimp.hpp:753
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1339
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:979
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:928
WeaponColumns(const EnchantableColumns &columns)
Definition: refidadapterimp.cpp:1396
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1422
AIActivate mActivate
Definition: aipackage.hpp:82
BaseRefIdAdapter(UniversalId::Type type, const BaseColumns &base)
Definition: refidadapterimp.hpp:57
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:2128
const RefIdColumn * mKey
Definition: refidadapterimp.hpp:827
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:834
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1142
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:2371
BodyPartRefIdAdapter(const BodyPartRefIdAdapter &)
IngredEffectRefIdAdapter()
Definition: refidadapterimp.cpp:84
const RefIdColumn * mOriginal
Definition: refidadapterimp.hpp:756
Definition: refidadapterimp.hpp:1054
Definition: refidadapterimp.hpp:675
EnchantableColumns(const InventoryColumns &base)
Definition: refidadapterimp.hpp:409
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:1116
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:670
virtual void setData(Record< ESXRecordT > &record, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:348
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:66
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:209
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:1153
Definition: refidadapterimp.hpp:714
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:908
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1248
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1145
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:807
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:1222
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1398
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:1208
NestedTravelRefIdAdapter(const NestedTravelRefIdAdapter &)
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:398
NestedInventoryRefIdAdapter & operator=(const NestedInventoryRefIdAdapter &)
NpcColumns(const ActorColumns &actorColumns)
Definition: refidadapterimp.cpp:690
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1014
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:214
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:91
int mType
Definition: aipackage.hpp:74
Definition: refidadapterimp.hpp:695
ActorAiRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1593
const RefIdColumn * mSpells
Definition: refidadapterimp.hpp:548
const RefIdColumn * mMisc
Definition: refidadapterimp.hpp:851
NAME32 mName
Definition: aipackage.hpp:54
const RefIdColumn * mText
Definition: refidadapterimp.hpp:699
InventoryColumns mInventory
Definition: refidadapterimp.hpp:258
UniversalId::Type mType
Definition: refidadapterimp.hpp:369
Definition: aipackage.hpp:62
Definition: columnbase.hpp:20
virtual ~BodyPartRefIdAdapter()
Definition: refidadapterimp.hpp:1918
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:75
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1303
State
Definition: record.hpp:10
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1920
LevListColumns mLevList
Definition: refidadapterimp.hpp:2060
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:2011
float mZ
Definition: aipackage.hpp:46
Definition: refidadapter.hpp:24
const RefIdColumn * mOrganic
Definition: refidadapterimp.hpp:735
BookRefIdAdapter(const EnchantableColumns &columns, const RefIdColumn *scroll, const RefIdColumn *skill, const RefIdColumn *text)
Definition: refidadapterimp.cpp:303
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1060
const RefIdColumn * mIcon
Definition: refidadapterimp.hpp:247
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:1403
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:1103
Definition: refidadapterimp.hpp:809
Definition: loadlevlist.hpp:75
Definition: refidadapterimp.hpp:1432
NpcSkillsRefIdAdapter()
Definition: refidadapterimp.cpp:899
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:2266
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:914
NestedSpellRefIdAdapter(const NestedSpellRefIdAdapter &)
NameColumns mName
Definition: refidadapterimp.hpp:189
UniversalId::Type mType
Definition: refidadapterimp.hpp:1093
const RecordBase & getRecord(const LocalIndex &index) const
Definition: refiddata.cpp:122
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1666
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1320
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1626
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1263
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:2170
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:1008
NestedInventoryRefIdAdapter(const NestedInventoryRefIdAdapter &)
Definition: refidadapterimp.hpp:2252
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:888
const RefIdColumn * mEffects
Definition: refidadapterimp.hpp:346
CreatureColumns(const ActorColumns &actorColumns)
Definition: refidadapterimp.cpp:454
NameColumns(const ModelColumns &base)
Definition: refidadapterimp.hpp:182
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1942
const RefIdColumn * mType
Definition: refidadapterimp.hpp:874
ActorRefIdAdapter(UniversalId::Type type, const ActorColumns &columns)
Definition: refidadapterimp.hpp:575
Definition: refidcollection.hpp:24
UniversalId::Type mType
Definition: refidadapterimp.hpp:2103
Adapter for IDs that can go into an inventory.
Definition: refidadapterimp.hpp:256
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:2134
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1391
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:1386
ToolColumns(const InventoryColumns &base)
Definition: refidadapterimp.hpp:478
Definition: aipackage.hpp:67
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:372
UniversalId::Type mType
Definition: refidadapterimp.hpp:1434
IngredientColumns(const InventoryColumns &columns)
Definition: refidadapterimp.cpp:58
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:1234
NestedListLevListRefIdAdapter(const NestedListLevListRefIdAdapter &)
UniversalId::Type mType
Definition: refidadapterimp.hpp:35
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:747
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1296
float mY
Definition: aipackage.hpp:46
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1113
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1379
NestedTravelRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1442
const RefIdColumn * mModified
Definition: refidadapterimp.hpp:26
ContainerRefIdAdapter(const NameColumns &columns, const RefIdColumn *weight, const RefIdColumn *organic, const RefIdColumn *respawn, const RefIdColumn *content)
Definition: refidadapterimp.cpp:392
const RefIdColumn * mChop[2]
Definition: refidadapterimp.hpp:878
Definition: refidadapterimp.hpp:473
const RefIdColumn * mEnchantmentPoints
Definition: refidadapterimp.hpp:407
MiscRefIdAdapter(const InventoryColumns &columns, const RefIdColumn *key)
Definition: refidadapterimp.cpp:654
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:1442
Definition: refidadapterimp.hpp:541
Definition: refidadapterimp.hpp:657
const RefIdColumn * mAttributes
Definition: refidadapterimp.hpp:757
const RefIdColumn * mId
Definition: refidadapterimp.hpp:25
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:279
UniversalId::Type getType() const
Definition: refidadapterimp.hpp:109
UniversalId::Type mType
Definition: refidadapterimp.hpp:1308
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1504
virtual void setId(RecordBase &record, const std::string &id)
Definition: refidadapterimp.hpp:62
DoorRefIdAdapter(const NameColumns &columns, const RefIdColumn *openSound, const RefIdColumn *closeSound)
Definition: refidadapterimp.cpp:538
CreatureMiscRefIdAdapter & operator=(const CreatureMiscRefIdAdapter &)
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:258
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:2039
std::string toString() const
Definition: esmcommon.hpp:58
const RefIdColumn * mAttributes
Definition: refidadapterimp.hpp:849
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:146
Definition: aipackage.hpp:65
const RefIdColumn * mContent
Definition: refidadapterimp.hpp:737
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:521
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1159
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:97
LevelledListRefIdAdapter(UniversalId::Type type, const LevListColumns &columns)
Definition: refidadapterimp.hpp:2075
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1541
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1972
virtual ~EffectsRefIdAdapter()
Definition: refidadapterimp.hpp:1103
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:1417
const RefIdColumn * mQuality
Definition: refidadapterimp.hpp:475
InventoryColumns(const NameColumns &base)
Definition: refidadapterimp.hpp:251
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:2287
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1643
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1599
Definition: refidadapterimp.hpp:2049
virtual void setTable(Record< ESXRecordT > &record, const NestedTableWrapperBase &nestedTable) const
Definition: nestedcoladapterimp.hpp:270
NpcAttributesRefIdAdapter()
Definition: refidadapterimp.cpp:792
NestedLevListRefIdAdapter & operator=(const NestedLevListRefIdAdapter &)
ToolColumns mTools
Definition: refidadapterimp.hpp:485
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:357
NestedInventoryRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1178
Definition: refidadapterimp.hpp:780
PotionRefIdAdapter(const PotionColumns &columns, const RefIdColumn *autoCalc)
Definition: refidadapterimp.cpp:15
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1959
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1231
virtual ~ActorAiRefIdAdapter()
Definition: refidadapterimp.hpp:1595
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:202
virtual ~IngredEffectRefIdAdapter()
Definition: refidadapterimp.cpp:88
Definition: loadlevlist.hpp:81
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:420
AITravel mTravel
Definition: aipackage.hpp:80
Definition: refidadapterimp.hpp:1906
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:505
const RefIdColumn * mFaction
Definition: refidadapterimp.hpp:846
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:437
std::map< const RefIdColumn *, unsigned int > mServices
Definition: refidadapterimp.hpp:551
unsigned char mTimeOfDay
Definition: aipackage.hpp:33
Definition: refidadapterimp.hpp:245
const RefIdColumn * mMisc
Definition: refidadapterimp.hpp:759
Definition: refidadapterimp.hpp:732
std::map< const RefIdColumn *, unsigned int > mFlags
Definition: refidadapterimp.hpp:843
virtual ~CreatureMiscRefIdAdapter()
Definition: refidadapterimp.cpp:1312
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1356
WeaponRefIdAdapter(const WeaponColumns &columns)
Definition: refidadapterimp.cpp:1399
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:1315
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:1291
const RefIdColumn * mHair
Definition: refidadapterimp.hpp:847
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1155
const RefIdColumn * mFlee
Definition: refidadapterimp.hpp:544
const ESXRecordT & get() const
Throws an exception, if the record is deleted.
Definition: record.hpp:106
Definition: refidadapterimp.hpp:1306
Definition: aipackage.hpp:72
LightColumns mColumns
Definition: refidadapterimp.hpp:811
short mDistance
Definition: aipackage.hpp:31
ModelColumns(const BaseColumns &base)
Definition: refidadapterimp.hpp:119
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1982
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:2034
const RefIdColumn * mUses
Definition: refidadapterimp.hpp:476
const RefIdColumn * mAutoCalc
Definition: refidadapterimp.hpp:330
const RefIdColumn * mHealth
Definition: refidadapterimp.hpp:875
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1573
Definition: refidadapterimp.hpp:115
WeaponColumns mColumns
Definition: refidadapterimp.hpp:888
const RefIdColumn * mRespawn
Definition: refidadapterimp.hpp:736
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:893
const RefIdColumn * mName
Definition: refidadapterimp.hpp:179
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1362
const RefIdColumn * mAiPackages
Definition: refidadapterimp.hpp:550
float mX
Definition: aipackage.hpp:40
const RefIdColumn * mValue
Definition: refidadapterimp.hpp:249
virtual ~NestedTravelRefIdAdapter()
Definition: refidadapterimp.hpp:1444
CreatureMiscRefIdAdapter()
Definition: refidadapterimp.cpp:1309
const RefIdColumn * mOpenSound
Definition: refidadapterimp.hpp:782
const RefIdColumn * mSlash[2]
Definition: refidadapterimp.hpp:879
Definition: refidadapterimp.hpp:856
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:37
std::map< const RefIdColumn *, unsigned int > mFlags
Definition: refidadapterimp.hpp:804
const RefIdColumn * mEffects
Definition: refidadapterimp.hpp:322
Definition: defs.hpp:38
const RefIdColumn * mFight
Definition: refidadapterimp.hpp:545
Definition: refidadapterimp.hpp:1025
virtual ~NestedInventoryRefIdAdapter()
Definition: refidadapterimp.hpp:1180
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1020
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:1182
ActorColumns(const NameColumns &base)
Definition: refidadapterimp.hpp:553
BodyPartRefIdAdapter & operator=(const BodyPartRefIdAdapter &)
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.cpp:327
LevListColumns(const BaseColumns &base)
Definition: refidadapterimp.hpp:2054
Definition: refidadapterimp.hpp:751
const RefIdColumn * mReach
Definition: refidadapterimp.hpp:877
void setModified(const ESXRecordT &modified)
Throws an exception, if the record is deleted.
Definition: record.hpp:133
const RefIdColumn * mType
Definition: refidadapterimp.hpp:27
Definition: refidadapterimp.hpp:886
ArmorRefIdAdapter(const EnchantableColumns &columns, const RefIdColumn *type, const RefIdColumn *health, const RefIdColumn *armor, const RefIdColumn *partRef)
Definition: refidadapterimp.cpp:251
NameRefIdAdapter(UniversalId::Type type, const NameColumns &columns)
Definition: refidadapterimp.hpp:204
float mX
Definition: aipackage.hpp:46
Position mPos
Definition: transport.hpp:21
Definition: refidadapterimp.hpp:327
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:98
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:1121
Definition: record.hpp:8
const RefIdColumn * mTime
Definition: refidadapterimp.hpp:800
Definition: aipackage.hpp:64
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:2376
Definition: refidadapterimp.hpp:963
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:175
NpcMiscRefIdAdapter()
Definition: refidadapterimp.cpp:990
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:861
virtual int getRowsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:398
Definition: refidadapterimp.hpp:177
Definition: refidadapterimp.hpp:2058
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:984
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:2116
NestedLevListRefIdAdapter(const NestedLevListRefIdAdapter &)
short mLevel
Definition: loadlevlist.hpp:34
ApparatusRefIdAdapter(const InventoryColumns &columns, const RefIdColumn *type, const RefIdColumn *quality)
Definition: refidadapterimp.cpp:208
const RefIdColumn * mType
Definition: refidadapterimp.hpp:754
Definition: refidadapterimp.hpp:320
NAME32 mId
Definition: aipackage.hpp:48
Definition: nestedtablewrapper.hpp:16
NestedSpellRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1316
float rot[3]
Definition: defs.hpp:43
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.cpp:197
Base adapter for all refereceable record types Adapters that can handle nested tables, needs to return valid qvariant for parent columns.
Definition: refidadapterimp.hpp:33
PotionColumns(const InventoryColumns &columns)
Definition: refidadapterimp.cpp:12
float mY
Definition: aipackage.hpp:40
unsigned char mIdle[8]
Definition: aipackage.hpp:34
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.hpp:1182
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1514
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:2091
LightColumns(const InventoryColumns &columns)
Definition: refidadapterimp.cpp:581
const RefIdColumn * mSkill
Definition: refidadapterimp.hpp:698
void assign(const std::string &value)
Definition: esmcommon.hpp:60
ActorAiRefIdAdapter(const ActorAiRefIdAdapter &)
Definition: refidadapterimp.hpp:404
virtual void removeRow(Record< ESXRecordT > &record, int rowToRemove) const
Definition: nestedcoladapterimp.hpp:256
Definition: refidadapterimp.hpp:1583
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:1122
virtual NestedTableWrapperBase * table(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:280
unsigned char mShouldRepeat
Definition: aipackage.hpp:35
Adapter for actor IDs (handles common AI functionality)
Definition: refidadapterimp.hpp:558
CreatureRefIdAdapter(const CreatureColumns &columns)
Definition: refidadapterimp.cpp:464
IngredEffectRefIdAdapter & operator=(const IngredEffectRefIdAdapter &)
BaseColumns mBase
Definition: refidadapterimp.hpp:36
Definition: loadlevlist.hpp:31
virtual void setNestedData(const RefIdColumn *column, RefIdData &data, int row, const QVariant &value, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1767
Definition: refidadapterimp.hpp:1091
EffectsRefIdAdapter & operator=(const EffectsRefIdAdapter &)
virtual int getNestedRowsCount(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1213
const RefIdColumn * mEnchantment
Definition: refidadapterimp.hpp:406
Definition: refidadapterimp.hpp:841
const RefIdColumn * mCloseSound
Definition: refidadapterimp.hpp:783
virtual void addRow(Record< ESXRecordT > &record, int position) const
Definition: nestedcoladapterimp.hpp:234
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1241
const RefIdColumn * mModel
Definition: refidadapterimp.hpp:117
virtual QVariant getData(const Record< ESXRecordT > &record, int subRowIndex, int subColIndex) const
Definition: nestedcoladapterimp.hpp:286
const RefIdColumn * mAttacks
Definition: refidadapterimp.hpp:758
std::string mFemale
Definition: loadarmo.hpp:50
Adapter for tools with limited uses IDs (lockpick, repair, probes)
Definition: refidadapterimp.hpp:483
CreatureAttackRefIdAdapter()
Definition: refidadapterimp.cpp:1219
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:581
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:996
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:821
EffectsRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1101
Definition: refidadapter.hpp:49
Definition: loadlevlist.hpp:55
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1129
CreatureColumns mColumns
Definition: refidadapterimp.hpp:766
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.cpp:1333
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1656
Definition: refidadapterimp.hpp:1168
ToolRefIdAdapter(UniversalId::Type type, const ToolColumns &columns)
Definition: refidadapterimp.hpp:500
Definition: refidadapterimp.hpp:798
ActorColumns mActors
Definition: refidadapterimp.hpp:560
LightRefIdAdapter(const LightColumns &columns)
Definition: refidadapterimp.cpp:584
Definition: refidadapterimp.hpp:367
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.hpp:1339
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:21
EnchantableColumns mEnchantable
Definition: refidadapterimp.hpp:416
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:1369
Definition: refidadapterimp.hpp:344
UniversalId::Type mType
Definition: refidadapterimp.hpp:1170
virtual void addNestedRow(const RefIdColumn *column, RefIdData &data, int index, int position) const
Definition: refidadapterimp.cpp:902
std::pair< int, UniversalId::Type > LocalIndex
Definition: refiddata.hpp:223
BodyPartRefIdAdapter(UniversalId::Type type)
Definition: refidadapterimp.hpp:1916
const RefIdColumn * mSpeed
Definition: refidadapterimp.hpp:876
UniversalId::Type mType
Definition: refidadapterimp.hpp:1908
const RefIdColumn * mClass
Definition: refidadapterimp.hpp:845
ClothingRefIdAdapter(const EnchantableColumns &columns, const RefIdColumn *type, const RefIdColumn *partRef)
Definition: refidadapterimp.cpp:351
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:298
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:941
const RefIdColumn * mQuality
Definition: refidadapterimp.hpp:660
virtual void setData(const RefIdColumn *column, RefIdData &data, int index, const QVariant &value) const
If the data type does not match an exception is thrown.
Definition: refidadapterimp.hpp:159
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.hpp:2304
const RefIdColumn * mWeight
Definition: refidadapterimp.hpp:734
UniversalId::Type mType
Definition: refidadapterimp.hpp:2254
Definition: refidadapterimp.hpp:764
Definition: refidadapterimp.hpp:905
const RefIdColumn * mHead
Definition: refidadapterimp.hpp:848
ActorAiRefIdAdapter & operator=(const ActorAiRefIdAdapter &)
const RefIdColumn * mSkills
Definition: refidadapterimp.hpp:850
const RefIdColumn * mHello
Definition: refidadapterimp.hpp:543
Definition: loadarmo.hpp:43
virtual void setNestedTable(const RefIdColumn *column, RefIdData &data, int index, const NestedTableWrapperBase &nestedTable) const
Definition: refidadapterimp.cpp:1128
virtual ~NpcMiscRefIdAdapter()
Definition: refidadapterimp.cpp:993
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:1321
IngredientColumns mColumns
Definition: refidadapterimp.hpp:353
Adapter for enchantable IDs.
Definition: refidadapterimp.hpp:414
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.hpp:1137
virtual QVariant getNestedData(const RefIdColumn *column, const RefIdData &data, int index, int subRowIndex, int subColIndex) const
Definition: refidadapterimp.cpp:130
virtual NestedTableWrapperBase * nestedTable(const RefIdColumn *column, const RefIdData &data, int index) const
Definition: refidadapterimp.hpp:2317
virtual int getColumnsCount(const Record< ESXRecordT > &record) const
Definition: nestedcoladapterimp.hpp:393
const RefIdColumn * mLevList
Definition: refidadapterimp.hpp:2051
NestedSpellRefIdAdapter & operator=(const NestedSpellRefIdAdapter &)
const RefIdColumn * mRadius
Definition: refidadapterimp.hpp:801
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData &data) const
Definition: refidadapterimp.hpp:1890
Definition: refidadapterimp.hpp:2101
const RefIdColumn * mScroll
Definition: refidadapterimp.hpp:697
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.cpp:588
float mZ
Definition: aipackage.hpp:40
virtual void removeNestedRow(const RefIdColumn *column, RefIdData &data, int index, int rowToRemove) const
Definition: refidadapterimp.cpp:801
std::map< const RefIdColumn *, unsigned int > mFlags
Definition: refidadapterimp.hpp:881
virtual QVariant getData(const RefIdColumn *column, const RefIdData &data, int index) const
If called on the nest column, should return QVariant(true).
Definition: refidadapterimp.hpp:2081
const RefIdColumn * mRace
Definition: refidadapterimp.hpp:844