mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
combined_editor function, and improved dependency handling (removing duplicates), viewer refreshes on events from script manager
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@147 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -38,6 +38,25 @@ class Dependency {
|
||||
inline Dependency makeCardIndependend() const {
|
||||
return Dependency(type == DEP_CARD_FIELD ? DEP_CARDS_FIELD : type, index, data);
|
||||
}
|
||||
|
||||
inline bool operator == (const Dependency& d) const {
|
||||
return type == d.type && index == d.index && data == d.data;
|
||||
}
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : Dependencies
|
||||
|
||||
/// A list of dependencies
|
||||
class Dependencies : public vector<Dependency> {
|
||||
public:
|
||||
/// Add a dependency, prevents duplicates
|
||||
inline void add(const Dependency& d) {
|
||||
if (find(begin(),end(),d) == end()) {
|
||||
push_back(d);
|
||||
}
|
||||
}
|
||||
private:
|
||||
using vector<Dependency>::push_back;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
Reference in New Issue
Block a user