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"
|
|
|
|
|
2012-10-01 15:17:04 +00:00
|
|
|
namespace MWWorld
|
2010-07-04 08:43:34 +00:00
|
|
|
{
|
|
|
|
struct ESMStore;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWScript
|
|
|
|
{
|
|
|
|
class GlobalScripts
|
|
|
|
{
|
2012-10-01 15:17:04 +00:00
|
|
|
const MWWorld::ESMStore& mStore;
|
2010-07-04 14:00:32 +00:00
|
|
|
std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-07-04 08:43:34 +00:00
|
|
|
public:
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2012-10-01 15:17:04 +00:00
|
|
|
GlobalScripts (const MWWorld::ESMStore& store);
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-07-04 08:43:34 +00:00
|
|
|
void addScript (const std::string& name);
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-07-04 14:00:32 +00:00
|
|
|
void removeScript (const std::string& name);
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-07-04 14:00:32 +00:00
|
|
|
bool isRunning (const std::string& name) const;
|
2012-04-23 13:27:03 +00:00
|
|
|
|
|
|
|
void run();
|
2010-07-04 14:00:32 +00:00
|
|
|
///< run all active global scripts
|
2010-07-04 08:43:34 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|