mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user