]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ParsedSource.h
fixed type of monster number properties
[l2e.git] / src / loader / ParsedSource.h
index 98ecd8423c401652f235c01a5ed7d68d40b1379b..5012729b93344e0f521b9fd79b1bf1803b384260 100644 (file)
@@ -36,7 +36,7 @@ public:
 
 public:
        explicit Literal(const std::vector<Value *> &);
-       explicit Literal(const std::vector<PropertyList *> &);
+       Literal(const std::string &, const std::vector<PropertyList *> &);
        explicit Literal(bool);
        Literal(int r, int g, int b, int a = 255);
        explicit Literal(int number);
@@ -51,6 +51,9 @@ private:
 
 public:
        Type GetType() const { return type; }
+       bool IsArray() const { return GetType() == ARRAY_VALUES || GetType() == ARRAY_PROPS; }
+       bool IsObject() const { return GetType() == OBJECT; }
+       int ArraySize() const { return GetType() == ARRAY_VALUES ? GetValues().size() : GetPropertyLists().size(); }
 
        const std::vector<Value *> &GetValues() const;
        const std::vector<PropertyList *> &GetPropertyLists() const;
@@ -68,7 +71,7 @@ public:
 
 private:
        PropertyList *props;
-       std::string str;
+       std::string typeName, str;
        std::vector<Value *> values;
        std::vector<PropertyList *> propertyLists;
        int i1, i2, i3, i4;