diff --git a/src/data/action/symbol.cpp b/src/data/action/symbol.cpp index 1577ea18..13673a6d 100644 --- a/src/data/action/symbol.cpp +++ b/src/data/action/symbol.cpp @@ -13,6 +13,8 @@ typedef pair pair_part_combine_t; typedef pair pair_part_size_t; DECLARE_TYPEOF_COLLECTION(pair_part_combine_t); DECLARE_TYPEOF_COLLECTION(pair_part_size_t); +DECLARE_TYPEOF_COLLECTION(SymbolPartP); +DECLARE_TYPEOF_COLLECTION(ControlPointP); // ----------------------------------------------------------------------------- : Moving symbol parts diff --git a/src/data/action/symbol_part.cpp b/src/data/action/symbol_part.cpp index 58f1e048..055b591f 100644 --- a/src/data/action/symbol_part.cpp +++ b/src/data/action/symbol_part.cpp @@ -8,7 +8,9 @@ #include #include + DECLARE_TYPEOF_COLLECTION(Vector2D); +DECLARE_TYPEOF_COLLECTION(ControlPointP); // ----------------------------------------------------------------------------- : Utility @@ -324,6 +326,7 @@ void SinglePointRemoveAction::perform(bool toUndo) { } DECLARE_POINTER_TYPE(SinglePointRemoveAction); +DECLARE_TYPEOF_COLLECTION(SinglePointRemoveActionP); // Remove a set of points from a symbol part. diff --git a/src/data/card.cpp b/src/data/card.cpp index 34492c5e..aea44857 100644 --- a/src/data/card.cpp +++ b/src/data/card.cpp @@ -11,6 +11,8 @@ #include #include +DECLARE_TYPEOF_COLLECTION(FieldP); + // ----------------------------------------------------------------------------- : Card IMPLEMENT_DYNAMIC_ARG(Game*, game_for_new_cards, nullptr); diff --git a/src/data/card.hpp b/src/data/card.hpp index 56314e1f..b84aac8d 100644 --- a/src/data/card.hpp +++ b/src/data/card.hpp @@ -14,7 +14,9 @@ #include class Game; +#ifndef HEADER_DATA_GAME DECLARE_POINTER_TYPE(Field); +#endif DECLARE_POINTER_TYPE(Value); DECLARE_POINTER_TYPE(CardStyle); diff --git a/src/data/game.cpp b/src/data/game.cpp index 86cb241c..dd5d169a 100644 --- a/src/data/game.cpp +++ b/src/data/game.cpp @@ -9,3 +9,7 @@ #include // ----------------------------------------------------------------------------- : Game + +bool Game::isMagic() const { + return name() == _("magic"); +} \ No newline at end of file diff --git a/src/data/game.hpp b/src/data/game.hpp index 57538389..e173f7ce 100644 --- a/src/data/game.hpp +++ b/src/data/game.hpp @@ -10,6 +10,7 @@ // ----------------------------------------------------------------------------- : Includes #include +#include #ifndef HEADER_DATA_CARD DECLARE_POINTER_TYPE(Field); @@ -17,12 +18,15 @@ DECLARE_POINTER_TYPE(Field); // ----------------------------------------------------------------------------- : Game -class Game { +class Game : public Packaged { public: String fullName; String iconFilename; vector setFields; vector cardFields; + + // Is this Magic the Gathering? + bool isMagic() const; }; // ----------------------------------------------------------------------------- : EOF diff --git a/src/data/set.hpp b/src/data/set.hpp index b1e1db9a..c5c02ee5 100644 --- a/src/data/set.hpp +++ b/src/data/set.hpp @@ -12,6 +12,7 @@ #include #include #include +#include DECLARE_POINTER_TYPE(Card); DECLARE_POINTER_TYPE(Set); @@ -20,7 +21,7 @@ DECLARE_POINTER_TYPE(Game); // ----------------------------------------------------------------------------- : Set /// A set of cards -class Set { +class Set : public Packaged { public: /// The game this set uses GameP game; @@ -52,8 +53,10 @@ class SetView : public ActionListener { /// The set that is currently being viewed, should not be modified directly! SetP set; - /// Called when another set is being viewn (using setSet) + /// 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() {} }; diff --git a/src/data/symbol.cpp b/src/data/symbol.cpp index f1b22c5f..cea18780 100644 --- a/src/data/symbol.cpp +++ b/src/data/symbol.cpp @@ -9,6 +9,9 @@ #include #include +DECLARE_TYPEOF_COLLECTION(SymbolPartP); +DECLARE_TYPEOF_COLLECTION(ControlPointP); + // ----------------------------------------------------------------------------- : ControlPoint IMPLEMENT_REFLECTION_ENUM(LockMode) { diff --git a/src/mse.vcproj b/src/mse.vcproj index 96201014..ecc3f428 100644 --- a/src/mse.vcproj +++ b/src/mse.vcproj @@ -322,15 +322,33 @@ + + + + + + + + + + + + @@ -558,6 +576,12 @@ + + + + + + + + + + + + + + + + + + + + + +