diff options
Diffstat (limited to 'ddl/templates/data.cs.ede')
-rw-r--r-- | ddl/templates/data.cs.ede | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ddl/templates/data.cs.ede b/ddl/templates/data.cs.ede index e7f4459..7a54b94 100644 --- a/ddl/templates/data.cs.ede +++ b/ddl/templates/data.cs.ede | |||
@@ -14,7 +14,7 @@ namespace {{ moduleName }} { | |||
14 | {% for t in dataAndType %} | 14 | {% for t in dataAndType %} |
15 | {% case t.value | constType %} | 15 | {% case t.value | constType %} |
16 | {% when "DataDef" %} | 16 | {% when "DataDef" %} |
17 | class {{ t.value.dataName }} { | 17 | public class {{ t.value.dataName }} { |
18 | public enum Tag { {% for c in t.value.constructors %} | 18 | public enum Tag { {% for c in t.value.constructors %} |
19 | {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %} | 19 | {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %} |
20 | }; | 20 | }; |
@@ -22,7 +22,7 @@ namespace {{ moduleName }} { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | namespace data { {% for c in t.value.constructors %}{% if !(c.value.fields | empty) %} | 24 | namespace data { {% for c in t.value.constructors %}{% if !(c.value.fields | empty) %} |
25 | class {{ c.value.name }} : {{ moduleName }}.{{ t.value.dataName }} { {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %} | 25 | public class {{ c.value.name }} : {{ moduleName }}.{{ t.value.dataName }} { {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %} |
26 | public {{ f.value.fieldType | csType }} {{ f.value.fieldName }};{% else %} | 26 | public {{ f.value.fieldType | csType }} {{ f.value.fieldName }};{% else %} |
27 | public {{ f.value.fieldType | csType | parens }} _{{ f.index0 }};{% endif %}{% endfor %} | 27 | public {{ f.value.fieldType | csType | parens }} _{{ f.index0 }};{% endif %}{% endfor %} |
28 | public {{ c.value.name }}() { tag = {{ moduleName }}.{{ t.value.dataName }}.Tag.{{ c.value.name }}; } | 28 | public {{ c.value.name }}() { tag = {{ moduleName }}.{{ t.value.dataName }}.Tag.{{ c.value.name }}; } |
@@ -32,11 +32,11 @@ namespace {{ moduleName }} { | |||
32 | {% endfor %} | 32 | {% endfor %} |
33 | 33 | ||
34 | // JSON deserializer | 34 | // JSON deserializer |
35 | enum Type { {% for t in usedTypes %} | 35 | public enum Type { {% for t in usedTypes %} |
36 | {{ t.value | typeEnum }}{% if !t.last %},{% endif %}{% endfor %} | 36 | {{ t.value | typeEnum }}{% if !t.last %},{% endif %}{% endfor %} |
37 | } | 37 | } |
38 | 38 | ||
39 | class Loader { | 39 | public class Loader { |
40 | public static object fromJSON(Type type, JToken obj) { | 40 | public static object fromJSON(Type type, JToken obj) { |
41 | switch (type) { | 41 | switch (type) { |
42 | {% for t in usedTypes %} | 42 | {% for t in usedTypes %} |