mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Dependency following now works
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@95 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -31,6 +31,14 @@ String Card::identification() const {
|
||||
return _("TODO");
|
||||
}
|
||||
|
||||
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.push_back(dep);
|
||||
}
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(Card) {
|
||||
REFLECT(stylesheet);
|
||||
REFLECT(notes);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <util/reflect.hpp>
|
||||
|
||||
class Game;
|
||||
class Dependency;
|
||||
DECLARE_POINTER_TYPE(Card);
|
||||
DECLARE_POINTER_TYPE(Field);
|
||||
DECLARE_POINTER_TYPE(Value);
|
||||
DECLARE_POINTER_TYPE(StyleSheet);
|
||||
@@ -43,5 +45,7 @@ class Card {
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
void mark_dependency_member(const CardP& value, const String& name, const Dependency& dep);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
@@ -95,6 +95,13 @@ void Set::validate(Version file_app_version) {
|
||||
*/ }
|
||||
}
|
||||
|
||||
void mark_dependency_member(Set* value, const String& name, const Dependency& dep) {
|
||||
// TODO
|
||||
}
|
||||
void mark_dependency_member(const SetP& value, const String& name, const Dependency& dep) {
|
||||
mark_dependency_member(value.get(), name, dep);
|
||||
}
|
||||
|
||||
// in scripts, set.something is read from the set_info
|
||||
template <typename Tag>
|
||||
void reflect_set_info_get_member(Tag& tag, const IndexMap<FieldP, ValueP>& data) {}
|
||||
|
||||
@@ -25,6 +25,7 @@ DECLARE_POINTER_TYPE(Value);
|
||||
DECLARE_POINTER_TYPE(Keyword);
|
||||
class ScriptManager;
|
||||
class Context;
|
||||
class Dependency;
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
|
||||
@@ -82,6 +83,9 @@ inline int item_count(const Set& set) {
|
||||
return (int)set.cards.size();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// ----------------------------------------------------------------------------- : SetView
|
||||
|
||||
/// A 'view' of a Set, is notified when the Set is updated
|
||||
|
||||
Reference in New Issue
Block a user