From 55749dcd629810ca75876dce77394faab40466e0 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 11 Apr 2014 18:37:59 +0000 Subject: Support create a variable directly from a script node instance --- project2/common/variables.cpp | 5 +++++ project2/common/variables.h | 1 + 2 files changed, 6 insertions(+) diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp index 29e694a..591a03e 100644 --- a/project2/common/variables.cpp +++ b/project2/common/variables.cpp @@ -124,6 +124,11 @@ Variable::makeParent(const Glib::ustring & name, bool attr, unsigned int dep) { return Variable(new VariableParent(name, attr, dep)); } +Variable +Variable::fromScriptNode(ScriptNodePtr p) +{ + return p->variable(); +} INSTANTIATESTORE(std::string, VariableLoader); diff --git a/project2/common/variables.h b/project2/common/variables.h index 7e9da3d..e0f1e00 100644 --- a/project2/common/variables.h +++ b/project2/common/variables.h @@ -33,6 +33,7 @@ class Variable { Variable(VariableType def); static Variable makeParent(const Glib::ustring & name, bool attr, unsigned int depth); + static Variable fromScriptNode(ScriptNodePtr); VariableType operator()(ExecContext * ec) const { return var->value(ec); } Variable & operator=(const VariableType &); -- cgit v1.2.3