implemented apprentice export

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@267 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-19 16:30:51 +00:00
parent f530cd7244
commit 0d328b750e
5 changed files with 800 additions and 4 deletions
+10
View File
@@ -55,6 +55,16 @@ class Card {
}
throw InternalError(_("Expected a card field with name '")+name+_("'"));
}
template <typename T> const T& value(const String& name) const {
for(IndexMap<FieldP, ValueP>::const_iterator it = data.begin() ; it != data.end() ; ++it) {
if ((*it)->fieldP->name == name) {
const T* ret = dynamic_cast<const T*>(it->get());
if (!ret) throw InternalError(_("Card field with name '")+name+_("' doesn't have the right type"));
return *ret;
}
}
throw InternalError(_("Expected a card field with name '")+name+_("'"));
}
DECLARE_REFLECTION();
};