diff --git a/apps/opencs/model/world/npcstats.hpp b/apps/opencs/model/world/npcstats.hpp index a020e04998..a5287d2b47 100644 --- a/apps/opencs/model/world/npcstats.hpp +++ b/apps/opencs/model/world/npcstats.hpp @@ -69,6 +69,6 @@ namespace CSMWorld }; } -Q_DECLARE_METATYPE(CSMWorld::NpcStats*); +Q_DECLARE_METATYPE(CSMWorld::NpcStats*) #endif // CSM_WORLD_NPCSTATS_H diff --git a/apps/opencs/model/world/refidadapterimp.cpp b/apps/opencs/model/world/refidadapterimp.cpp index 085c77ca37..56c4835f82 100644 --- a/apps/opencs/model/world/refidadapterimp.cpp +++ b/apps/opencs/model/world/refidadapterimp.cpp @@ -1122,6 +1122,7 @@ void CSMWorld::WeaponRefIdAdapter::setData (const RefIdColumn *column, RefIdData } } +template <> void CSMWorld::NestedSpellRefIdAdapter::addNestedRow (const RefIdColumn *column, RefIdData& data, int index, int position) const { @@ -1145,6 +1146,7 @@ void CSMWorld::NestedSpellRefIdAdapter::addNestedRow (const RefIdColum record.setModified (caster); } +template <> void CSMWorld::NestedSpellRefIdAdapter::removeNestedRow (const RefIdColumn *column, RefIdData& data, int index, int rowToRemove) const { @@ -1175,6 +1177,7 @@ void CSMWorld::NestedSpellRefIdAdapter::removeNestedRow (const RefIdCo record.setModified (caster); } +template <> void CSMWorld::NestedSpellRefIdAdapter::setNestedData (const RefIdColumn *column, RefIdData& data, int row, const QVariant& value, int subRowIndex, int subColIndex) const { @@ -1207,6 +1210,7 @@ void CSMWorld::NestedSpellRefIdAdapter::setNestedData (const RefIdColu record.setModified (caster); } +template <> QVariant CSMWorld::NestedSpellRefIdAdapter::getNestedData (const RefIdColumn *column, const RefIdData& data, int index, int subRowIndex, int subColIndex) const { @@ -1230,12 +1234,14 @@ QVariant CSMWorld::NestedSpellRefIdAdapter::getNestedData (const RefId } } +template <> int CSMWorld::NestedSpellRefIdAdapter::getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const { return 5; } +template <> int CSMWorld::NestedSpellRefIdAdapter::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const { const Record& record = diff --git a/apps/opencs/model/world/usertype.hpp b/apps/opencs/model/world/usertype.hpp index e0b3c2e2f5..23b5c90a48 100644 --- a/apps/opencs/model/world/usertype.hpp +++ b/apps/opencs/model/world/usertype.hpp @@ -38,7 +38,7 @@ namespace CSMWorld }; } -Q_DECLARE_METATYPE(CSMWorld::UserInt); -Q_DECLARE_METATYPE(CSMWorld::UserFloat); +Q_DECLARE_METATYPE(CSMWorld::UserInt) +Q_DECLARE_METATYPE(CSMWorld::UserFloat) #endif // CSM_WORLD_USERTYPE_H diff --git a/apps/openmw/mwworld/mwstore.cpp b/apps/openmw/mwworld/mwstore.cpp new file mode 100644 index 0000000000..02c7106b63 --- /dev/null +++ b/apps/openmw/mwworld/mwstore.cpp @@ -0,0 +1,36 @@ +#include "mwstore.hpp" + +#include "../mwbase/world.hpp" +#include "../mwbase/environment.hpp" + +#include "esmstore.hpp" + +namespace MWWorld +{ + MWStore::MWStore() + : mGmst(MWBase::Environment::get().getWorld()->getStore().get()), + mSpells(MWBase::Environment::get().getWorld()->getStore().get()) + { } + + MWStore::~MWStore() + { } + + int MWStore::findGmstInt(const std::string& name) const { return mGmst.find(name)->getInt(); } + + float MWStore::findGmstFloat(const std::string& name) const { return mGmst.find(name)->getFloat(); } + + const ESM::Skill *MWStore::findSkill(int index) const + { + return MWBase::Environment::get().getWorld()->getStore().get().find(index); + } + + const ESM::MagicEffect* MWStore::findMagicEffect(int id) const + { + return MWBase::Environment::get().getWorld()->getStore().get().find(id); + } + + const GamePlay::CommonStore& MWStore::getSpells() const + { + return MWBase::Environment::get().getWorld()->getStore().get(); + } +} diff --git a/apps/openmw/mwworld/mwstore.hpp b/apps/openmw/mwworld/mwstore.hpp new file mode 100644 index 0000000000..c616e4e1d0 --- /dev/null +++ b/apps/openmw/mwworld/mwstore.hpp @@ -0,0 +1,34 @@ +#ifndef GAME_MWWORLD_MWSTORE_H +#define GAME_MWWORLD_MWSTORE_H + +#include + +#include + +#include "store.hpp" + +namespace MWWorld +{ + class MWStore : public GamePlay::StoreWrap + { + const MWWorld::Store& mGmst; + const MWWorld::Store &mSpells; + + public: + + MWStore(); + ~MWStore(); + + virtual int findGmstInt(const std::string& name) const; + + virtual float findGmstFloat(const std::string& name) const; + + virtual const ESM::Skill *findSkill(int index) const; + + virtual const ESM::MagicEffect* findMagicEffect(int id) const; + + virtual const GamePlay::CommonStore& getSpells() const; + }; +} + +#endif // GAME_MWWORLD_MWSTORE_H