mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
start with implementing fields
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@12 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+32
-2
@@ -9,8 +9,38 @@
|
||||
#include <data/field.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Field
|
||||
|
||||
IMPLEMENT_REFLECTION(Field) {
|
||||
}
|
||||
|
||||
template <>
|
||||
shared_ptr<Field> read_new<Field>(Reader& reader) {
|
||||
// there must be a type specified
|
||||
String type;
|
||||
reader.handle(_("type"), type);
|
||||
// if (type == _("text")) {
|
||||
// } else {
|
||||
throw "TODO";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : Style
|
||||
|
||||
IMPLEMENT_REFLECTION(Style) {
|
||||
}
|
||||
|
||||
void initObject(const FieldP& field, StyleP& style) {
|
||||
style = field->newStyle(field);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Value
|
||||
|
||||
void initObject(const FieldP& field, ValueP& value) {
|
||||
value = new_shared<Value>();
|
||||
IMPLEMENT_REFLECTION(Value) {
|
||||
}
|
||||
|
||||
void initObject(const FieldP& field, ValueP& value) {
|
||||
value = field->newValue(field);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user