Added 'or else' construct to script language.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@423 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-06-14 18:31:47 +00:00
parent 40e55e8151
commit e287348843
8 changed files with 119 additions and 16 deletions
+8 -1
View File
@@ -29,10 +29,12 @@ class ScriptableImage {
inline ScriptableImage(const String& script) : script(script) {}
inline ScriptableImage(const GeneratedImageP& gen) : value(gen) {}
/// Is there an image set?
/// Is there a scripted image set?
inline bool isScripted() const { return script; }
/// Is there an image generator available?
inline bool isReady() const { return value; }
/// Is there an image set?
inline bool isSet() const { return script || value; }
/// Generate an image.
Image generate(const GeneratedImage::Options& options, bool cache = false) const;
@@ -49,6 +51,11 @@ class ScriptableImage {
/// Can this be safely generated from another thread?
inline bool threadSafe() const { return !value || value->threadSafe(); }
/// Get access to the script, be careful
inline Script& getScript() { return script.getScript(); }
/// Get access to the script, always returns a valid script
ScriptP getScriptP();
private:
OptionalScript script; ///< The script, not really optional
GeneratedImageP value; ///< The image generator