#include "../graphics/ComplexAnimation.h"
#include <map>
-#include <set>
#include <stdexcept>
#include <string>
#include <vector>
public:
Interpreter(const ParsedSource &source) : source(source) { }
- ~Interpreter() { }
+ ~Interpreter();
private:
Interpreter(const Interpreter &);
Interpreter &operator =(const Interpreter &);
private:
const ParsedSource &source;
- std::set<std::string> parsedDefinitions;
-
- std::map<std::string, graphics::Animation *> animations;
- std::map<std::string, battle::Hero *> heroes;
- std::map<std::string, battle::Monster *> monsters;
- std::map<std::string, int> numbers;
- std::map<std::string, graphics::Sprite *> sprites;
+ enum DynamicType {
+ ANIMATION,
+ COMPLEX_ANIMATION,
+ HERO,
+ MONSTER,
+ NUMBER,
+ SIMPLE_ANIMATION,
+ SPRITE,
+ };
+ struct ParsedDefinition {
+ ParsedDefinition(const Definition *dfn, DynamicType type, int index)
+ : dfn(dfn), type(type), index(index) { }
+ bool IsCompatible(DynamicType with) const;
+ const Definition *dfn;
+ DynamicType type;
+ int index;
+ };
+ std::map<std::string, ParsedDefinition> parsedDefinitions;
+
+ std::vector<graphics::Animation *> animations;
+ std::vector<battle::Hero> heroes;
+ std::vector<SDL_Surface *> images;
+ std::vector<battle::Monster> monsters;
+ std::vector<int> numbers;
+ std::vector<graphics::Sprite> sprites;
};