#ifndef CSM_WOLRD_COLUMNS_H #define CSM_WOLRD_COLUMNS_H #include "idcollection.hpp" namespace CSMWorld { template struct FloatValueColumn : public Column { FloatValueColumn() : Column ("Value") {} virtual QVariant get (const Record& record) const { return record.get().mValue; } virtual void set (Record& record, const QVariant& data) { ESXRecordT base = record.getBase(); base.mValue = data.toFloat(); record.setModified (base); } virtual bool isEditable() const { return true; } }; template struct StringIdColumn : public Column { StringIdColumn() : Column ("ID") {} virtual QVariant get (const Record& record) const { return record.get().mId.c_str(); } virtual bool isEditable() const { return false; } }; template struct RecordStateColumn : public Column { RecordStateColumn() : Column ("*") {} virtual QVariant get (const Record& record) const { if (record.mState==Record::State_Erased) return static_cast (Record::State_Deleted); return static_cast (record.mState); } virtual bool isEditable() const { return false; } }; } #endif