Added word lists for choosing things like card type;

Added 'in_place' pattern to spec_sort

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@616 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-08-23 16:33:12 +00:00
parent 9e35698194
commit 9f2b30b2db
23 changed files with 461 additions and 60 deletions
+2 -1
View File
@@ -12,6 +12,7 @@
#include <data/keyword.hpp>
#include <data/statistics.hpp>
#include <data/pack.hpp>
#include <data/word_list.hpp>
#include <util/io/package_manager.hpp>
#include <script/script.hpp>
@@ -56,7 +57,7 @@ IMPLEMENT_REFLECTION(Game) {
REFLECT(keyword_modes);
REFLECT(keyword_parameter_types);
REFLECT_NO_SCRIPT(keywords);
// REFLECT(word_lists);
REFLECT(word_lists);
}
void Game::validate(Version v) {
+2
View File
@@ -24,6 +24,7 @@ DECLARE_POINTER_TYPE(PackType);
DECLARE_POINTER_TYPE(KeywordParam);
DECLARE_POINTER_TYPE(KeywordMode);
DECLARE_POINTER_TYPE(Keyword);
DECLARE_POINTER_TYPE(WordList);
// ----------------------------------------------------------------------------- : Game
@@ -43,6 +44,7 @@ class Game : public Packaged {
vector<StatsDimensionP> statistics_dimensions; ///< (Additional) statistics dimensions
vector<StatsCategoryP> statistics_categories; ///< (Additional) statistics categories
vector<PackTypeP> pack_types; ///< Types of random card packs to generate
vector<WordListP> word_lists; ///< Word lists for editing with a drop down list
bool has_keywords; ///< Does this game use keywords?
OptionalScript keyword_match_script; ///< For the keyword editor
+34
View File
@@ -0,0 +1,34 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <data/word_list.hpp>
// ----------------------------------------------------------------------------- : WordList
WordListWord::WordListWord()
: line_below(false)
, is_prefix(false)
{}
IMPLEMENT_REFLECTION_NO_SCRIPT(WordListWord) {
if (line_below || is_prefix || isGroup() || (tag.reading() && tag.isComplex())) {
// complex value
REFLECT(name);
REFLECT(line_below);
REFLECT(is_prefix);
REFLECT(words);
} else {
REFLECT_NAMELESS(name);
}
}
IMPLEMENT_REFLECTION_NO_SCRIPT(WordList) {
REFLECT(name);
REFLECT(words);
}
+43
View File
@@ -0,0 +1,43 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_DATA_WORD_LIST
#define HEADER_DATA_WORD_LIST
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/reflect.hpp>
DECLARE_POINTER_TYPE(WordListWord);
DECLARE_POINTER_TYPE(WordList);
// ----------------------------------------------------------------------------- : WordList
/// A word in a WordList
class WordListWord : public IntrusivePtrBase<WordListWord> {
public:
WordListWord();
String name; ///< Name of the list / the word
bool line_below; ///< Line below in the list?
bool is_prefix; ///< Is this a prefix before other words?
vector<WordListWordP> words; ///< Sublist
inline bool isGroup() const { return !words.empty(); }
DECLARE_REFLECTION();
};
/// A list of words for a drop down box
class WordList : public WordListWord {
public:
DECLARE_REFLECTION();
};
// ----------------------------------------------------------------------------- : EOF
#endif