Some more data types; dynamic arguments

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@5 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-01 19:40:39 +00:00
parent 50b22e9478
commit 331423bd07
27 changed files with 431 additions and 95 deletions
+35
View File
@@ -0,0 +1,35 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <data/set.hpp>
#include <data/card.hpp>
// ----------------------------------------------------------------------------- : Set
IMPLEMENT_REFLECTION(Set) {
WITH_DYNAMIC_ARG(game_for_new_cards, game.get()) {
REFLECT_N("card", cards);
}
}
// ----------------------------------------------------------------------------- : SetView
SetView::SetView() {}
SetView::~SetView() {
if (set) set->actions.removeListener(this);
}
void SetView::setSet(const SetP& newSet) {
// no longer listening to old set
if (set) set->actions.removeListener(this);
set = newSet;
// start listening to new set
if (set) set->actions.addListener(this);
onChangeSet();
}