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:
twanvl
2006-10-09 16:21:38 +00:00
parent 35ece4674d
commit b6c7e5bd01
16 changed files with 453 additions and 21 deletions
+32 -2
View File
@@ -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);
}