2012-12-30 13:01:52 +00:00
|
|
|
#ifndef CSM_WOLRD_DATA_H
|
|
|
|
#define CSM_WOLRD_DATA_H
|
2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
#include <map>
|
2012-12-30 13:01:52 +00:00
|
|
|
#include <vector>
|
2012-11-26 11:29:22 +00:00
|
|
|
|
2013-02-07 10:33:08 +00:00
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
2012-11-26 11:29:22 +00:00
|
|
|
#include <components/esm/loadglob.hpp>
|
2013-02-08 08:58:19 +00:00
|
|
|
#include <components/esm/loadgmst.hpp>
|
2013-03-21 13:31:32 +00:00
|
|
|
#include <components/esm/loadskil.hpp>
|
2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
#include "idcollection.hpp"
|
|
|
|
#include "universalid.hpp"
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
class QAbstractItemModel;
|
2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class Data
|
|
|
|
{
|
|
|
|
IdCollection<ESM::Global> mGlobals;
|
2013-02-08 08:58:19 +00:00
|
|
|
IdCollection<ESM::GameSetting> mGmsts;
|
2013-03-21 13:31:32 +00:00
|
|
|
IdCollection<ESM::Skill> mSkills;
|
2013-03-21 09:07:25 +00:00
|
|
|
std::vector<QAbstractItemModel *> mModels;
|
|
|
|
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;
|
2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
Data (const Data&);
|
|
|
|
Data& operator= (const Data&);
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
void addModel (QAbstractItemModel *model, UniversalId::Type type1,
|
2012-12-30 13:01:52 +00:00
|
|
|
UniversalId::Type type2 = UniversalId::Type_None);
|
|
|
|
|
2012-11-26 11:29:22 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
Data();
|
|
|
|
|
|
|
|
~Data();
|
|
|
|
|
|
|
|
const IdCollection<ESM::Global>& getGlobals() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Global>& getGlobals();
|
|
|
|
|
2013-02-17 19:03:39 +00:00
|
|
|
const IdCollection<ESM::GameSetting>& getGmsts() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::GameSetting>& getGmsts();
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
QAbstractItemModel *getTableModel (const UniversalId& id);
|
2012-12-30 13:01:52 +00:00
|
|
|
///< If no table model is available for \a id, an exception is thrown.
|
|
|
|
///
|
|
|
|
/// \note The returned table may either be the model for the ID itself or the model that
|
|
|
|
/// contains the record specified by the ID.
|
2012-12-03 12:56:02 +00:00
|
|
|
|
|
|
|
void merge();
|
|
|
|
///< Merge modified into base.
|
2013-02-07 10:33:08 +00:00
|
|
|
|
|
|
|
void loadFile (const boost::filesystem::path& path, bool base);
|
|
|
|
///< Merging content of a file into base or modified.
|
2012-11-26 11:29:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|