1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

85 lines
2.4 KiB
C++
Raw Normal View History

#ifndef CSM_WOLRD_DATA_H
#define CSM_WOLRD_DATA_H
#include <map>
#include <vector>
2013-02-07 11:33:08 +01:00
#include <boost/filesystem/path.hpp>
#include <components/esm/loadglob.hpp>
2013-02-08 09:58:19 +01:00
#include <components/esm/loadgmst.hpp>
#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>
#include "idcollection.hpp"
#include "universalid.hpp"
class QAbstractItemModel;
namespace CSMWorld
{
class Data
{
IdCollection<ESM::Global> mGlobals;
2013-02-08 09:58:19 +01:00
IdCollection<ESM::GameSetting> mGmsts;
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;
std::vector<QAbstractItemModel *> mModels;
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;
// not implemented
Data (const Data&);
Data& operator= (const Data&);
void addModel (QAbstractItemModel *model, UniversalId::Type type1,
UniversalId::Type type2 = UniversalId::Type_None);
public:
Data();
~Data();
const IdCollection<ESM::Global>& getGlobals() const;
IdCollection<ESM::Global>& getGlobals();
const IdCollection<ESM::GameSetting>& getGmsts() const;
IdCollection<ESM::GameSetting>& getGmsts();
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();
QAbstractItemModel *getTableModel (const UniversalId& id);
///< 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.
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.
};
}
#endif