mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Added version number to files; IndexMap now works with GetMember
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@40 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+10
-1
@@ -50,4 +50,13 @@ IMPLEMENT_REFLECTION(Game) {
|
||||
void Game::validate() {
|
||||
// a default for the full name
|
||||
if (full_name.empty()) full_name = name();
|
||||
}
|
||||
}
|
||||
|
||||
// special behaviour of reading/writing GamePs: only read/write the name
|
||||
|
||||
void Reader::handle(GameP& game) {
|
||||
game = Game::byName(value);
|
||||
}
|
||||
void Writer::handle(const GameP& game) {
|
||||
handle(game->name());
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <data/set.hpp>
|
||||
#include <data/game.hpp>
|
||||
#include <data/card.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <script/value.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
@@ -21,9 +23,15 @@ Set::Set() {}
|
||||
String Set::typeName() const { return _("set"); }
|
||||
|
||||
IMPLEMENT_REFLECTION(Set) {
|
||||
REFLECT(game);
|
||||
if (data.empty() && game) {
|
||||
data.init(game->set_fields);
|
||||
}
|
||||
REFLECT_N("set_info", data);
|
||||
WITH_DYNAMIC_ARG(game_for_new_cards, game.get()) {
|
||||
REFLECT(cards);
|
||||
}
|
||||
REFLECT(apprentice_code);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ DECLARE_POINTER_TYPE(Card);
|
||||
DECLARE_POINTER_TYPE(Set);
|
||||
DECLARE_POINTER_TYPE(Game);
|
||||
DECLARE_POINTER_TYPE(Stylesheet);
|
||||
DECLARE_POINTER_TYPE(Field);
|
||||
DECLARE_POINTER_TYPE(Value);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
|
||||
@@ -33,8 +35,13 @@ class Set : public Packaged {
|
||||
GameP game;
|
||||
/// The default stylesheet
|
||||
StylesheetP stylesheet;
|
||||
/// The values on the fields of the set
|
||||
/** The indices should correspond to the set_fields in the Game */
|
||||
IndexMap<FieldP, ValueP> data;
|
||||
/// The cards in the set
|
||||
vector<CardP> cards;
|
||||
/// Code to use for apprentice (Magic only)
|
||||
String apprentice_code;
|
||||
/// Actions performed on this set and the cards in it
|
||||
ActionStack actions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user