mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
dependency handling for keywords
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@265 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -143,6 +143,13 @@
|
||||
SCRIPT_RULE_2_N(funname, type1, _(#name1), name1, type2, _(#name2), name2)
|
||||
/// Utility for defining a script rule with two named parameters
|
||||
#define SCRIPT_RULE_2_N(funname, type1, str1, name1, type2, str2, name2) \
|
||||
SCRIPT_RULE_2_N_AUX(funname, type1, str1, name1, type2, str2, name2, ;)
|
||||
/// Utility for defining a script rule with two named parameters, with dependencies
|
||||
#define SCRIPT_RULE_2_N_DEP(funname, type1, str1, name1, type2, str2, name2)\
|
||||
SCRIPT_RULE_2_N_AUX( funname, type1, str1, name1, type2, str2, name2,\
|
||||
virtual ScriptValueP dependencies(Context&, const Dependency&) const;)
|
||||
|
||||
#define SCRIPT_RULE_2_N_AUX(funname, type1, str1, name1, type2, str2, name2, dep) \
|
||||
class ScriptRule_##funname: public ScriptValue { \
|
||||
public: \
|
||||
inline ScriptRule_##funname(const type1& name1, const type2& name2) \
|
||||
@@ -150,6 +157,7 @@
|
||||
virtual ScriptType type() const { return SCRIPT_FUNCTION; } \
|
||||
virtual String typeName() const { return _(#funname)_("_rule"); } \
|
||||
virtual ScriptValueP eval(Context& ctx) const; \
|
||||
dep \
|
||||
private: \
|
||||
type1 name1; \
|
||||
type2 name2; \
|
||||
@@ -166,6 +174,9 @@
|
||||
} \
|
||||
ScriptValueP ScriptRule_##funname::eval(Context& ctx) const
|
||||
|
||||
#define SCRIPT_RULE_2_DEPENDENCIES(name) \
|
||||
ScriptValueP ScriptRule_##name::dependencies(Context& ctx, const Dependency& dep) const
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user