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:
twanvl
2007-03-21 18:04:09 +00:00
parent fddc389e24
commit 0c6068d6a2
14 changed files with 139 additions and 25 deletions
+19
View File
@@ -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;
}
}
}