2012-12-30 14:01:52 +01:00
|
|
|
#ifndef CSM_WOLRD_DATA_H
|
|
|
|
#define CSM_WOLRD_DATA_H
|
2012-11-26 12:29:22 +01:00
|
|
|
|
|
|
|
#include <map>
|
2012-12-30 14:01:52 +01:00
|
|
|
#include <vector>
|
2012-11-26 12:29:22 +01:00
|
|
|
|
2013-02-07 11:33:08 +01:00
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
#include <components/esm/loadglob.hpp>
|
2013-02-08 09:58:19 +01:00
|
|
|
#include <components/esm/loadgmst.hpp>
|
2013-03-21 14:31:32 +01:00
|
|
|
#include <components/esm/loadskil.hpp>
|
2013-03-25 13:22:06 +01:00
|
|
|
#include <components/esm/loadclas.hpp>
|
2013-04-02 12:00:45 +02:00
|
|
|
#include <components/esm/loadfact.hpp>
|
2013-04-04 14:34:39 +02:00
|
|
|
#include <components/esm/loadrace.hpp>
|
2013-04-06 21:21:10 +02:00
|
|
|
#include <components/esm/loadsoun.hpp>
|
2013-04-07 15:17:35 +02:00
|
|
|
#include <components/esm/loadscpt.hpp>
|
2012-11-26 12:29:22 +01:00
|
|
|
|
|
|
|
#include "idcollection.hpp"
|
|
|
|
#include "universalid.hpp"
|
|
|
|
|
2013-03-21 10:07:25 +01:00
|
|
|
class QAbstractItemModel;
|
2012-11-26 12:29:22 +01:00
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class Data
|
|
|
|
{
|
|
|
|
IdCollection<ESM::Global> mGlobals;
|
2013-02-08 09:58:19 +01:00
|
|
|
IdCollection<ESM::GameSetting> mGmsts;
|
2013-03-21 14:31:32 +01:00
|
|
|
IdCollection<ESM::Skill> mSkills;
|
2013-03-25 13:22:06 +01:00
|
|
|
IdCollection<ESM::Class> mClasses;
|
2013-04-02 12:00:45 +02:00
|
|
|
IdCollection<ESM::Faction> mFactions;
|
2013-04-04 14:34:39 +02:00
|
|
|
IdCollection<ESM::Race> mRaces;
|
2013-04-06 21:21:10 +02:00
|
|
|
IdCollection<ESM::Sound> mSounds;
|
2013-04-07 15:17:35 +02:00
|
|
|
IdCollection<ESM::Script> mScripts;
|
2013-03-21 10:07:25 +01:00
|
|
|
std::vector<QAbstractItemModel *> mModels;
|
|
|
|
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;
|
2012-11-26 12:29:22 +01:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
Data (const Data&);
|
|
|
|
Data& operator= (const Data&);
|
|
|
|
|
2013-03-21 10:07:25 +01:00
|
|
|
void addModel (QAbstractItemModel *model, UniversalId::Type type1,
|
2012-12-30 14:01:52 +01:00
|
|
|
UniversalId::Type type2 = UniversalId::Type_None);
|
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
Data();
|
|
|
|
|
|
|
|
~Data();
|
|
|
|
|
|
|
|
const IdCollection<ESM::Global>& getGlobals() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Global>& getGlobals();
|
|
|
|
|
2013-02-17 20:03:39 +01:00
|
|
|
const IdCollection<ESM::GameSetting>& getGmsts() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::GameSetting>& getGmsts();
|
|
|
|
|
2013-03-24 15:10:03 +01:00
|
|
|
const IdCollection<ESM::Skill>& getSkills() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Skill>& getSkills();
|
|
|
|
|
2013-04-04 10:10:26 +02:00
|
|
|
const IdCollection<ESM::Class>& getClasses() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Class>& getClasses();
|
|
|
|
|
2013-04-02 12:00:45 +02:00
|
|
|
const IdCollection<ESM::Faction>& getFactions() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Faction>& getFactions();
|
|
|
|
|
2013-04-04 14:34:39 +02:00
|
|
|
const IdCollection<ESM::Race>& getRaces() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Race>& getRaces();
|
|
|
|
|
2013-04-06 21:21:10 +02:00
|
|
|
const IdCollection<ESM::Sound>& getSounds() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Sound>& getSounds();
|
|
|
|
|
2013-04-07 15:17:35 +02:00
|
|
|
const IdCollection<ESM::Script>& getScripts() const;
|
|
|
|
|
|
|
|
IdCollection<ESM::Script>& getScripts();
|
|
|
|
|
2013-03-21 10:07:25 +01:00
|
|
|
QAbstractItemModel *getTableModel (const UniversalId& id);
|
2012-12-30 14:01:52 +01: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 13:56:02 +01:00
|
|
|
|
|
|
|
void merge();
|
|
|
|
///< Merge modified into base.
|
2013-02-07 11:33:08 +01:00
|
|
|
|
|
|
|
void loadFile (const boost::filesystem::path& path, bool base);
|
|
|
|
///< Merging content of a file into base or modified.
|
2012-11-26 12:29:22 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|