2010-07-03 13:41:20 +00:00
|
|
|
#ifndef GAME_MWWORLD_WORLD_H
|
|
|
|
#define GAME_MWWORLD_WORLD_H
|
2010-07-02 07:38:22 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
#include <components/esm_store/cell_store.hpp>
|
2010-07-02 07:38:22 +00:00
|
|
|
|
2010-07-04 11:33:33 +00:00
|
|
|
#include <components/interpreter/types.hpp>
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
#include "../mwrender/playerpos.hpp"
|
|
|
|
#include "../mwrender/mwscene.hpp"
|
2010-07-03 13:04:00 +00:00
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
#include "refdata.hpp"
|
2010-07-03 15:46:55 +00:00
|
|
|
#include "ptr.hpp"
|
2010-07-02 11:48:48 +00:00
|
|
|
|
2010-07-02 07:38:22 +00:00
|
|
|
namespace Render
|
|
|
|
{
|
|
|
|
class OgreRenderer;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class SkyManager;
|
|
|
|
class CellRender;
|
|
|
|
}
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
namespace MWWorld
|
2010-07-02 07:38:22 +00:00
|
|
|
{
|
|
|
|
/// \brief The game world and its visual representation
|
|
|
|
|
|
|
|
class World
|
|
|
|
{
|
2010-07-02 14:18:25 +00:00
|
|
|
public:
|
|
|
|
|
2010-07-03 15:46:55 +00:00
|
|
|
typedef std::vector<std::pair<std::string, Ptr> > ScriptList;
|
2010-07-02 14:18:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2010-07-02 11:48:48 +00:00
|
|
|
typedef ESMS::CellStore<RefData> CellStore;
|
|
|
|
typedef std::map<CellStore *, MWRender::CellRender *> CellRenderCollection;
|
2010-07-02 07:38:22 +00:00
|
|
|
|
|
|
|
MWRender::SkyManager* mSkyManager;
|
|
|
|
MWRender::MWScene mScene;
|
|
|
|
MWRender::PlayerPos mPlayerPos;
|
|
|
|
CellRenderCollection mActiveCells;
|
|
|
|
CellRenderCollection mBufferedCells; // loaded, but not active (buffering not implementd yet)
|
|
|
|
ESM::ESMReader mEsm;
|
|
|
|
ESMS::ESMStore mStore;
|
2010-07-02 11:48:48 +00:00
|
|
|
std::map<std::string, CellStore> mInteriors;
|
2010-07-02 14:18:25 +00:00
|
|
|
ScriptList mLocalScripts;
|
2010-07-04 11:33:33 +00:00
|
|
|
std::map<std::string, Interpreter::Type_Data> mGlobalVariables;
|
2010-07-02 07:38:22 +00:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
World (const World&);
|
|
|
|
World& operator= (const World&);
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
void insertInteriorScripts (ESMS::CellStore<RefData>& cell);
|
2010-07-02 14:18:25 +00:00
|
|
|
|
2010-07-02 07:38:22 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
World (Render::OgreRenderer& renderer, const boost::filesystem::path& master,
|
2010-07-04 14:00:32 +00:00
|
|
|
const std::string& dataDir, const std::string& startCell, bool newGame);
|
2010-07-02 07:38:22 +00:00
|
|
|
|
|
|
|
~World();
|
|
|
|
|
|
|
|
MWRender::PlayerPos& getPlayerPos();
|
2010-07-02 14:18:25 +00:00
|
|
|
|
|
|
|
ESMS::ESMStore& getStore();
|
|
|
|
|
|
|
|
const ScriptList& getLocalScripts() const;
|
|
|
|
///< Names and local variable state of all local scripts in active cells.
|
2010-07-03 10:12:13 +00:00
|
|
|
|
|
|
|
bool hasCellChanged() const;
|
|
|
|
///< Has the player moved to a different cell, since the last frame?
|
2010-07-04 11:33:33 +00:00
|
|
|
|
|
|
|
Interpreter::Type_Data& getGlobalVariable (const std::string& name);
|
2010-07-02 07:38:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|