mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
implemented reflection
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@27 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -24,7 +24,7 @@ void store(const ScriptValueP& val, Defaultable<String>& var) { var.assign(*val)
|
||||
|
||||
OptionalScript::~OptionalScript() {}
|
||||
|
||||
ScriptValueP OptionalScript::invoke(Context& ctx) {
|
||||
ScriptValueP OptionalScript::invoke(Context& ctx) const {
|
||||
if (script) {
|
||||
return ctx.eval(*script);
|
||||
} else {
|
||||
@@ -44,14 +44,11 @@ template <> void Writer::handle(const OptionalScript& os) {
|
||||
handle(os.unparsed);
|
||||
}
|
||||
|
||||
template <> void GetMember::handle(const OptionalScript& os) {
|
||||
// no members
|
||||
}
|
||||
template <> void GetMember::store(const OptionalScript& os) {
|
||||
template <> void GetDefaultMember::handle(const OptionalScript& os) {
|
||||
// reflect as the script itself
|
||||
if (os.script) {
|
||||
store(os.script);
|
||||
handle(os.script);
|
||||
} else {
|
||||
store(script_nil);
|
||||
handle(script_nil);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user