2010-07-04 08:43:34 +00:00
|
|
|
#ifndef GAME_SCRIPT_GLOBALSCRIPTS_H
|
|
|
|
#define GAME_SCRIPT_GLOBALSCRIPTS_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "locals.hpp"
|
|
|
|
|
|
|
|
namespace ESMS
|
|
|
|
{
|
|
|
|
struct ESMStore;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Environment;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWScript
|
|
|
|
{
|
|
|
|
class ScriptManager;
|
|
|
|
|
|
|
|
class GlobalScripts
|
|
|
|
{
|
|
|
|
const ESMS::ESMStore& mStore;
|
|
|
|
ScriptManager& mScriptManager;
|
2010-07-04 14:00:32 +00:00
|
|
|
std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables
|
2010-07-04 08:43:34 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
GlobalScripts (const ESMS::ESMStore& store, ScriptManager& scriptManager);
|
|
|
|
|
|
|
|
void addScript (const std::string& name);
|
|
|
|
|
2010-07-04 14:00:32 +00:00
|
|
|
void removeScript (const std::string& name);
|
|
|
|
|
|
|
|
bool isRunning (const std::string& name) const;
|
|
|
|
|
2010-07-04 08:43:34 +00:00
|
|
|
void run (MWWorld::Environment& environment);
|
2010-07-04 14:00:32 +00:00
|
|
|
///< run all active global scripts
|
2010-07-04 08:43:34 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|