mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Added Alignment, Defaultable and Scriptable types, needed some reflection tweaks for the last two.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@17 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+14
-1
@@ -12,6 +12,8 @@
|
||||
#include <util/prec.hpp>
|
||||
#include <wx/txtstrm.h>
|
||||
|
||||
template <typename T> class Defaultable;
|
||||
|
||||
// ----------------------------------------------------------------------------- : Reader
|
||||
|
||||
typedef wxInputStream InputStream;
|
||||
@@ -57,6 +59,8 @@ class Reader {
|
||||
template <typename T> void handle(shared_ptr<T>& pointer);
|
||||
/// Reads a map from the input stream
|
||||
//template <typename K, typename V> void handle(map<K,V>& map);
|
||||
/// Reads a Defaultable from the input stream
|
||||
template <typename T> void handle(Defaultable<T>& def);
|
||||
|
||||
private:
|
||||
// --------------------------------------------------- : Data
|
||||
@@ -130,7 +134,16 @@ void Reader::handle(shared_ptr<T>& pointer) {
|
||||
/// Implement reflection as used by Reader
|
||||
#define REFLECT_OBJECT_READER(Cls) \
|
||||
template<> void Reader::handle<Cls>(Cls& object) { \
|
||||
object.reflect(*this); \
|
||||
while (indent >= expected_indent) { \
|
||||
UInt l = line_number; \
|
||||
object.reflect(*this); \
|
||||
if (l == line_number) { \
|
||||
/* error */ \
|
||||
do { \
|
||||
moveNext(); \
|
||||
} while (indent > expected_indent); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Reflection for enumerations
|
||||
|
||||
Reference in New Issue
Block a user