mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
paritially implemented MultipleChoice viewer/editor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@222 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -51,3 +51,22 @@ IMPLEMENT_REFLECTION(MultipleChoiceStyle) {
|
||||
IMPLEMENT_REFLECTION_NAMELESS(MultipleChoiceValue) {
|
||||
REFLECT_BASE(ChoiceValue);
|
||||
}
|
||||
|
||||
void MultipleChoiceValue::get(vector<String>& out) const {
|
||||
// split the value
|
||||
out.clear();
|
||||
bool is_new = true;
|
||||
FOR_EACH_CONST(c, value()) {
|
||||
if (c == _(',')) {
|
||||
is_new = true;
|
||||
} else if (is_new) {
|
||||
if (c != _(' ')) { // ignore whitespace after ,
|
||||
is_new = false;
|
||||
out.push_back(String(1, c));
|
||||
}
|
||||
} else {
|
||||
assert(!out.empty());
|
||||
out.back() += c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user