summaryrefslogtreecommitdiff
path: root/hscript/key.hh
diff options
context:
space:
mode:
Diffstat (limited to 'hscript/key.hh')
-rw-r--r--hscript/key.hh27
1 files changed, 20 insertions, 7 deletions
diff --git a/hscript/key.hh b/hscript/key.hh
index 06d34f8..7c398ca 100644
--- a/hscript/key.hh
+++ b/hscript/key.hh
@@ -28,18 +28,31 @@ public:
void setData(std::string data);
/*! Determines if the data associated with the Key is valid. */
- bool isValid();
+ bool validate();
+ /*! Executes the action associated with this Key.
+ * Will always return `false` if `validate` is `false`.
+ */
+ bool execute();
+};
+
+/*! Describes a Key class. */
+typedef struct KeyDesc {
+ /*! The name of the Key. */
+ std::string name;
/*! Determines if the Key is required to be present for the HorizonScript
* to be considered valid. */
- static bool isRequired();
-
+ bool required;
/*! Determines how many times this Key can be repeated.
- * If this function returns 0, it can be repeated an unlimited number of times.
- * If this function returns 1, it can only be present once per HorizonScript.
+ * If this value is 0, it can be repeated an unlimited number of times.
+ * If this value is 1, it can only be present once per HorizonScript.
*/
- static int maxCount();
-};
+ int repeat;
+ /*! Order of the Key. Determines when the Key will be executed. */
+ int order;
+ /*! The function used to create a new Key of this type. */
+ Key*(*key_create_fn)(void);
+} key_desc_t;
}
}