mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
scripting language now has support for list and map literals: " [a,b,c] "
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@422 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -257,11 +257,16 @@ class ScriptCustomCollectionIterator : public ScriptIterator {
|
||||
};
|
||||
|
||||
ScriptValueP ScriptCustomCollection::getMember(const String& name) const {
|
||||
long index;
|
||||
if (name.ToLong(&index) && index >= 0 && (size_t)index < value.size()) {
|
||||
return value.at(index);
|
||||
map<String,ScriptValueP>::const_iterator it = key_value.find(name);
|
||||
if (it != key_value.end()) {
|
||||
return it->second;
|
||||
} else {
|
||||
return ScriptValue::getMember(name);
|
||||
long index;
|
||||
if (name.ToLong(&index) && index >= 0 && (size_t)index < value.size()) {
|
||||
return value.at(index);
|
||||
} else {
|
||||
return ScriptValue::getMember(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
ScriptValueP ScriptCustomCollection::makeIterator(const ScriptValueP& thisP) const {
|
||||
|
||||
Reference in New Issue
Block a user