mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
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:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user