]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
added interpretation of colors
[l2e.git] / src / loader / Interpreter.h
index 7755a1beb01e767684f5db5561143b48661b4cca..b91e4781d901cefbb4a5dfa446d2c6b6787e1660 100644 (file)
@@ -9,6 +9,7 @@
 #define LOADER_INTERPRETER_H_
 
 #include "../geometry/Vector.h"
+#include "../graphics/Color.h"
 #include "../graphics/ComplexAnimation.h"
 
 #include <map>
@@ -68,6 +69,7 @@ public:
 public:
        graphics::Animation *GetAnimation(const std::string &name);
        bool GetBoolean(const std::string &name) const;
+       const graphics::Color &GetColor(const std::string &name) const;
        graphics::Font *GetFont(const std::string &name);
        graphics::Frame *GetFrame(const std::string &name);
        graphics::Gauge *GetGauge(const std::string &name);
@@ -86,6 +88,7 @@ public:
 
 public:
        const std::vector<bool> &Booleans() const { return booleans; }
+       const std::vector<graphics::Color> &Colors() const { return colors; }
        const std::vector<graphics::ComplexAnimation *> &ComplexAnimations() const { return complexAnimations; }
        const std::vector<graphics::Font *> &Fonts() const { return fonts; }
        const std::vector<graphics::Frame *> &Frames() const { return frames; }
@@ -110,6 +113,7 @@ private:
        void ReadObject(const Definition &);
 
        graphics::Animation *GetAnimation(const Value &);
+       graphics::Color GetColor(const Value &);
        bool GetBoolean(const Value &);
        graphics::Font *GetFont(const Value &);
        graphics::Frame *GetFrame(const Value &);
@@ -150,6 +154,7 @@ private:
        const ParsedSource &source;
        enum Type {
                BOOLEAN,
+               COLOR,
                COMPLEX_ANIMATION,
                FONT,
                FRAME,
@@ -183,6 +188,7 @@ private:
        std::map<std::string, SDL_Surface *> imageCache;
 
        std::vector<bool> booleans;
+       std::vector<graphics::Color> colors;
        std::vector<graphics::ComplexAnimation *> complexAnimations;
        std::vector<graphics::Font *> fonts;
        std::vector<graphics::Frame *> frames;