mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Fixed dependencies for 'styling';
Fixed: specific character prefered over .* for keywords git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@306 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+2
-6
@@ -43,12 +43,8 @@ String Card::identification() const {
|
||||
}
|
||||
}
|
||||
|
||||
void mark_dependency_member(const CardP& card, const String& name, const Dependency& dep) {
|
||||
// Find field with that name
|
||||
IndexMap<FieldP,ValueP>::const_iterator it = card->data.find(name);
|
||||
if (it != card->data.end()) {
|
||||
(*it)->fieldP->dependent_scripts.add(dep);
|
||||
}
|
||||
void mark_dependency_member(const Card& card, const String& name, const Dependency& dep) {
|
||||
mark_dependency_member(card.data, name, dep);
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(Card) {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ class Card {
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
void mark_dependency_member(const CardP& value, const String& name, const Dependency& dep);
|
||||
void mark_dependency_member(const Card& value, const String& name, const Dependency& dep);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
@@ -137,3 +137,12 @@ void init_object(const FieldP& field, ValueP& value) {
|
||||
template <> ValueP read_new<Value>(Reader&) {
|
||||
throw InternalError(_("IndexMap contains nullptr ValueP the application should have crashed already"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mark_dependency_member(const IndexMap<FieldP,ValueP>& value, const String& name, const Dependency& dep) {
|
||||
IndexMap<FieldP,ValueP>::const_iterator it = value.find(name);
|
||||
if (it != value.end()) {
|
||||
(*it)->fieldP->dependent_scripts.add(dep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,5 +186,7 @@ template <> ValueP read_new<Value>(Reader&);
|
||||
return *static_cast<Type ## Field*>(fieldP.get()); \
|
||||
}
|
||||
|
||||
void mark_dependency_member(const IndexMap<FieldP,ValueP>& value, const String& name, const Dependency& dep);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
@@ -361,13 +361,14 @@ String KeywordDatabase::expand(const String& text,
|
||||
}
|
||||
// find 'next' trie node set matching c
|
||||
FOR_EACH(kt, current) {
|
||||
if (kt->on_any_star) {
|
||||
next.push_back(kt->on_any_star);
|
||||
}
|
||||
map<Char,KeywordTrie*>::const_iterator it = kt->children.find(c);
|
||||
if (it != kt->children.end()) {
|
||||
next.push_back(it->second);
|
||||
}
|
||||
// TODO: on any star first or last?
|
||||
if (kt->on_any_star) {
|
||||
next.push_back(kt->on_any_star);
|
||||
}
|
||||
}
|
||||
// next becomes current
|
||||
swap(current, next);
|
||||
|
||||
+4
-10
@@ -154,25 +154,19 @@ ScriptValueP make_iterator(const Set& set) {
|
||||
return new_intrusive1<ScriptCollectionIterator<vector<CardP> > >(&set.cards);
|
||||
}
|
||||
|
||||
void mark_dependency_member(Set* value, const String& name, const Dependency& dep) {
|
||||
void mark_dependency_member(const Set& set, const String& name, const Dependency& dep) {
|
||||
// is it the card list?
|
||||
if (name == _("cards")) {
|
||||
value->game->dependent_scripts_cards.add(dep);
|
||||
set.game->dependent_scripts_cards.add(dep);
|
||||
return;
|
||||
}
|
||||
// is it the keywords?
|
||||
if (name == _("keywords")) {
|
||||
value->game->dependent_scripts_keywords.add(dep);
|
||||
set.game->dependent_scripts_keywords.add(dep);
|
||||
return;
|
||||
}
|
||||
// is it in the set data?
|
||||
IndexMap<FieldP,ValueP>::const_iterator it = value->data.find(name);
|
||||
if (it != value->data.end()) {
|
||||
(*it)->fieldP->dependent_scripts.add(dep);
|
||||
}
|
||||
}
|
||||
void mark_dependency_member(const SetP& value, const String& name, const Dependency& dep) {
|
||||
mark_dependency_member(value.get(), name, dep);
|
||||
mark_dependency_member(set.data, name, dep);
|
||||
}
|
||||
|
||||
// in scripts, set.something is read from the set_info
|
||||
|
||||
+1
-2
@@ -122,8 +122,7 @@ inline int item_count(const Set& set) {
|
||||
}
|
||||
ScriptValueP make_iterator(const Set& set);
|
||||
|
||||
void mark_dependency_member(const SetP& value, const String& name, const Dependency& dep);
|
||||
void mark_dependency_member(Set* value, const String& name, const Dependency& dep);
|
||||
void mark_dependency_member(const Set& set, const String& name, const Dependency& dep);
|
||||
|
||||
// ----------------------------------------------------------------------------- : SetView
|
||||
|
||||
|
||||
Reference in New Issue
Block a user