implemented identification

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@131 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-19 22:16:54 +00:00
parent 2504eb908b
commit e04b210c40
+14 -1
View File
@@ -13,6 +13,8 @@
#include <script/value.hpp>
DECLARE_TYPEOF_COLLECTION(FieldP);
typedef IndexMap<FieldP,ValueP> IndexMap_FieldP_ValueP;
DECLARE_TYPEOF_NO_REV(IndexMap_FieldP_ValueP);
// ----------------------------------------------------------------------------- : Card
@@ -28,7 +30,18 @@ Card::Card(const Game& game) {
}
String Card::identification() const {
return _("TODO");
// an identifying field
FOR_EACH_CONST(v, data) {
if (v->fieldP->identifying) {
return v->toString();
}
}
// otherwise the first field
if (!data.empty()) {
return data.at(0)->toString();
} else {
return wxEmptyString;
}
}
void mark_dependency_member(const CardP& card, const String& name, const Dependency& dep) {