made dependency analysis work without errors for magic-new (except for a few script functions); implemented the rest of the ScriptManager

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@71 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-01 16:41:50 +00:00
parent 2dd93a91fb
commit f18bdafab1
17 changed files with 280 additions and 45 deletions
+8 -2
View File
@@ -12,6 +12,7 @@
#include <util/prec.hpp>
#include <util/reflect.hpp>
#include <util/alignment.hpp>
#include <util/age.hpp>
#include <script/scriptable.hpp>
#include <script/dependency.hpp>
@@ -96,6 +97,8 @@ class Style {
/** thisP is a smart pointer to this */
virtual ValueEditorP makeEditor(DataEditor& parent, const StyleP& thisP) = 0;
/// Update scripted values of this style, return true if anything has changed
virtual bool update(Context&);
/// Add the given dependency to the dependet_scripts list for the variables this style depends on
virtual void initDependencies(Context&, const Dependency&) const;
@@ -116,10 +119,13 @@ class Value {
inline Value(const FieldP& field) : fieldP(field) {}
virtual ~Value();
const FieldP fieldP; ///< Field this value is for, should have the right type!
const FieldP fieldP; ///< Field this value is for, should have the right type!
Age last_script_update; ///< When where the scripts last updated? (by calling update)
/// Convert this value to a string for use in tables
virtual String toString() const = 0;
/// Apply scripts to this value, return true if the value has changed
virtual bool update(Context&) { last_script_update.update(); return false; }
private:
DECLARE_REFLECTION_VIRTUAL();