2010-07-18 14:48:01 +00:00
|
|
|
#ifndef GAME_MWWORLD_GLOBALS_H
|
|
|
|
#define GAME_MWWORLD_GLOBALS_H
|
|
|
|
|
2012-12-20 23:16:34 +00:00
|
|
|
#include <vector>
|
2010-07-18 14:48:01 +00:00
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <components/interpreter/types.hpp>
|
2013-12-10 14:09:58 +00:00
|
|
|
#include <components/esm/variant.hpp>
|
2010-07-18 14:48:01 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-10-01 15:17:04 +00:00
|
|
|
class ESMStore;
|
|
|
|
|
2010-07-18 14:48:01 +00:00
|
|
|
class Globals
|
|
|
|
{
|
|
|
|
private:
|
2013-12-10 14:09:58 +00:00
|
|
|
|
|
|
|
typedef std::map<std::string, ESM::Variant> Collection;
|
|
|
|
|
2010-07-18 14:48:01 +00:00
|
|
|
Collection mVariables; // type, value
|
2013-12-10 14:09:58 +00:00
|
|
|
|
2010-07-18 14:48:01 +00:00
|
|
|
Collection::const_iterator find (const std::string& name) const;
|
|
|
|
|
|
|
|
Collection::iterator find (const std::string& name);
|
2013-12-10 14:09:58 +00:00
|
|
|
|
2010-07-18 14:48:01 +00:00
|
|
|
public:
|
2013-12-10 14:09:58 +00:00
|
|
|
|
|
|
|
const ESM::Variant& operator[] (const std::string& name) const;
|
|
|
|
|
|
|
|
ESM::Variant& operator[] (const std::string& name);
|
|
|
|
|
2010-07-21 13:01:35 +00:00
|
|
|
char getType (const std::string& name) const;
|
|
|
|
///< If there is no global variable with this name, ' ' is returned.
|
2012-12-20 23:16:34 +00:00
|
|
|
|
2013-12-10 14:09:58 +00:00
|
|
|
void fill (const MWWorld::ESMStore& store);
|
|
|
|
///< Replace variables with variables from \a store with default values.
|
2010-07-18 14:48:01 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|