Dependency following now works

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@95 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-25 22:48:14 +00:00
parent 9a62445621
commit 8dcda6fd93
16 changed files with 108 additions and 12 deletions
+8
View File
@@ -220,6 +220,10 @@ int item_count(const T& v) {
return -1;
}
/// Mark a dependency on a member of value, can be overloaded
template <typename T>
void mark_dependency_member(const T& value, const String& name, const Dependency& dep) {}
/// Script value containing an object (pointer)
template <typename T>
class ScriptObject : public ScriptValue {
@@ -245,6 +249,10 @@ class ScriptObject : public ScriptValue {
}
}
}
virtual ScriptValueP dependencyMember(const String& name, const Dependency& dep) const {
mark_dependency_member(value, name, dep);
return getMember(name);
}
virtual int itemCount() const {
int i = item_count(*value);
return i >= 0 ? i : ScriptValue::itemCount();