Euphoria
game.cc
Go to the documentation of this file.
1 #include "files/game.h"
2 
3 
4 namespace eu::files::game
5 {
7  {
9 
10  JSON_VAL(Number, x);
11  JSON_VAL(Number, y);
12 
14  }
15 
17  {
19 
20  JSON_VAL(String, path);
21 
23  }
24 
26  {
28 
29  JSON_VAL(Number, value);
30 
32  }
33 
35  {
37 
38  JSON_VAL(String, name);
39 
40  // only one is valid
41  JSON_VAL_OPT_OBJ(VarNumber, number);
42 
44  }
45 
47  {
49 
50  JSON_VAL(String, name);
51  JSON_ARRAY(Var, arguments);
52 
54  }
55 
57  {
59 
60  // only one is valid
61  JSON_VAL_OPT_OBJ(vec2f, position);
62  JSON_VAL_OPT_OBJ(Sprite, sprite);
63  JSON_VAL_OPT_OBJ(Custom, custom);
64 
66  }
67 
69  {
71 
72  JSON_VAL(String, name);
73  JSON_ARRAY(Component, components);
74 
76  }
77 
79  {
81 
85 
86  JSON_END_ENUM();
87  }
88 
90  {
92 
94  JSON_VAL(Number, width);
95  JSON_VAL(Number, height);
96 
98  }
99 
101 
103  {
105 
106  JSON_VAL(String, name);
107  JSON_VAL(String, key);
108 
109  JSON_END_OBJECT();
110  }
111 
113 
115  {
117 
118  // todo(Gustav): change to a rgb property
119  JSON_OPT_VAL(String, hex);
120 
121  JSON_END_OBJECT();
122  }
123 
125  {
127 
128  JSON_VAL(String, title);
129  JSON_VAL_OPT_OBJ(Color, clear_color);
130  JSON_VAL_OBJ(Viewport, viewport);
131  JSON_ARRAY(KeyBind, binds);
132  JSON_ARRAY(Template, templates);
133 
134  JSON_END_OBJECT();
135  }
136 }
#define JSON_VAL_OPT_OBJ(TYPE, PROP)
Definition: json.h:125
#define JSON_END_ENUM()
Definition: json.h:80
#define JSON_BEGIN_ENUM(TYPE)
Definition: json.h:65
#define JSON_BEGIN_OBJECT()
Definition: json.h:86
#define JSON_VAL_OBJ(TYPE, PROP)
Definition: json.h:124
#define JSON_VAL(TYPE, PROP)
Definition: json.h:128
#define JSON_END_OBJECT()
Definition: json.h:166
#define JSON_ENUM_VAL(VAL)
Definition: json.h:72
#define JSON_ARRAY(TYPE, PROP)
Definition: json.h:132
#define JSON_OPT_VAL(TYPE, PROP)
Definition: json.h:129
JSON_PARSE_FUNC(vec2f)
Definition: game.cc:6