|
|
|
@ -29,4 +29,40 @@ void CSMWorld::PotionRefIdAdapter::setData (const RefIdColumn *column, RefIdData
|
|
|
|
|
record.get().mData.mAutoCalc = value.toInt();
|
|
|
|
|
else
|
|
|
|
|
InventoryRefIdAdapter<ESM::Potion>::setData (column, data, index, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CSMWorld::ApparatusRefIdAdapter::ApparatusRefIdAdapter (const InventoryColumns& columns,
|
|
|
|
|
const RefIdColumn *type, const RefIdColumn *quality)
|
|
|
|
|
: InventoryRefIdAdapter<ESM::Apparatus> (UniversalId::Type_Apparatus, columns),
|
|
|
|
|
mType (type), mQuality (quality)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
QVariant CSMWorld::ApparatusRefIdAdapter::getData (const RefIdColumn *column,
|
|
|
|
|
const RefIdData& data, int index) const
|
|
|
|
|
{
|
|
|
|
|
const Record<ESM::Apparatus>& record = static_cast<const Record<ESM::Apparatus>&> (
|
|
|
|
|
data.getRecord (RefIdData::LocalIndex (index, UniversalId::Type_Apparatus)));
|
|
|
|
|
|
|
|
|
|
if (column==mType)
|
|
|
|
|
return record.get().mData.mType;
|
|
|
|
|
|
|
|
|
|
if (column==mQuality)
|
|
|
|
|
return record.get().mData.mQuality;
|
|
|
|
|
|
|
|
|
|
return InventoryRefIdAdapter<ESM::Apparatus>::getData (column, data, index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMWorld::ApparatusRefIdAdapter::setData (const RefIdColumn *column, RefIdData& data, int index,
|
|
|
|
|
const QVariant& value) const
|
|
|
|
|
{
|
|
|
|
|
Record<ESM::Apparatus>& record = static_cast<Record<ESM::Apparatus>&> (
|
|
|
|
|
data.getRecord (RefIdData::LocalIndex (index, UniversalId::Type_Apparatus)));
|
|
|
|
|
|
|
|
|
|
if (column==mType)
|
|
|
|
|
record.get().mData.mType = value.toInt();
|
|
|
|
|
else if (column==mQuality)
|
|
|
|
|
record.get().mData.mQuality = value.toFloat();
|
|
|
|
|
else
|
|
|
|
|
InventoryRefIdAdapter<ESM::Apparatus>::setData (column, data, index, value);
|
|
|
|
|
}
|