mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
177f1a211f
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@9 0fc631ac-6414-0410-93d0-97cfa31319b6
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
//+----------------------------------------------------------------------------+
|
|
//| 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) |
|
|
//+----------------------------------------------------------------------------+
|
|
|
|
#ifndef HEADER_DATA_SET
|
|
#define HEADER_DATA_SET
|
|
|
|
// ----------------------------------------------------------------------------- : Includes
|
|
|
|
#include <util/prec.hpp>
|
|
#include <util/reflect.hpp>
|
|
#include <util/action_stack.hpp>
|
|
#include <util/io/package.hpp>
|
|
|
|
DECLARE_POINTER_TYPE(Card);
|
|
DECLARE_POINTER_TYPE(Set);
|
|
DECLARE_POINTER_TYPE(Game);
|
|
|
|
// ----------------------------------------------------------------------------- : Set
|
|
|
|
/// A set of cards
|
|
class Set : public Packaged {
|
|
public:
|
|
/// The game this set uses
|
|
GameP game;
|
|
/// The cards in the set
|
|
vector<CardP> cards;
|
|
/// Actions performed on this set and the cards in it
|
|
ActionStack actions;
|
|
|
|
DECLARE_REFLECTION();
|
|
};
|
|
|
|
|
|
// ----------------------------------------------------------------------------- : SetView
|
|
|
|
/// A 'view' of a Set, is notified when the Set is updated
|
|
/** To listen to events, derived classes should override onAction(const Action&)
|
|
*/
|
|
class SetView : public ActionListener {
|
|
public:
|
|
SetView();
|
|
~SetView();
|
|
|
|
/// Get the set that is currently being viewed
|
|
inline SetP getSet() { return set; }
|
|
/// Change the set that is being viewed
|
|
void setSet(const SetP& set);
|
|
|
|
protected:
|
|
/// The set that is currently being viewed, should not be modified directly!
|
|
SetP set;
|
|
|
|
/// Called when another set is being viewed (using setSet)
|
|
virtual void onChangeSet() {}
|
|
/// Called when just before another set is being viewed (using setSet)
|
|
virtual void onBeforeChangeSet() {}
|
|
};
|
|
|
|
|
|
// ----------------------------------------------------------------------------- : EOF
|
|
#endif
|