1 /*
2  * This file has been automatically generated by Soupply and released under the MIT license.
3  * Generated from data/java210.xml
4  */
5 module soupply.java210.types;
6 
7 static import std.conv;
8 import xpacket;
9 
10 import xserial.serial : EndianType, serializeLength, deserializeLength;
11 
12 import xbuffer.memory : xalloc, xfree;
13 
14 import soupply.util;
15 import soupply.java210.metadata;
16 
17 struct Statistic
18 {
19 
20     enum string[] __fields = ["name", "value"];
21 
22     string name;
23     @Var uint value;
24 
25     mixin Make!(Endian.bigEndian, varuint);
26 
27     string toString()
28     {
29         return "Statistic(name: " ~ std.conv.to!string(this.name) ~ ", value: " ~ std.conv.to!string(this.value) ~ ")";
30     }
31 
32 }
33 
34 struct BlockChange
35 {
36 
37     enum string[] __fields = ["xz", "y", "block"];
38 
39     ubyte xz;
40     ubyte y;
41     @Var uint block;
42 
43     mixin Make!(Endian.bigEndian, varuint);
44 
45     string toString()
46     {
47         return "BlockChange(xz: " ~ std.conv.to!string(this.xz) ~ ", y: " ~ std.conv.to!string(this.y) ~ ", block: " ~ std.conv.to!string(this.block) ~ ")";
48     }
49 
50 }
51 
52 struct Slot
53 {
54 
55     enum string[] __fields = ["id", "count", "damage", "nbt"];
56 
57     short id;
58     @Condition("id>0") ubyte count;
59     @Condition("id>0") ushort damage;
60     @Condition("id>0") @NoLength ubyte[] nbt;
61 
62     mixin Make!(Endian.bigEndian, varuint);
63 
64     string toString()
65     {
66         return "Slot(id: " ~ std.conv.to!string(this.id) ~ ", count: " ~ std.conv.to!string(this.count) ~ ", damage: " ~ std.conv.to!string(this.damage) ~ ", nbt: " ~ std.conv.to!string(this.nbt) ~ ")";
67     }
68 
69 }
70 
71 struct Icon
72 {
73 
74     // direction and type
75     enum ubyte WHITE_ARROW = 0;
76     enum ubyte GREEN_ARROW = 1;
77     enum ubyte RED_ARROW = 2;
78     enum ubyte BLUE_ARROW = 3;
79     enum ubyte WHITE_CROSS = 4;
80     enum ubyte RED_POINTER = 5;
81     enum ubyte WHITE_CIRCLE = 6;
82 
83     enum string[] __fields = ["directionAndType", "position"];
84 
85     ubyte directionAndType;
86     Vector!(ubyte, "xz") position;
87 
88     mixin Make!(Endian.bigEndian, varuint);
89 
90     string toString()
91     {
92         return "Icon(directionAndType: " ~ std.conv.to!string(this.directionAndType) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")";
93     }
94 
95 }
96 
97 struct Property
98 {
99 
100     enum string[] __fields = ["name", "value", "signed", "signature"];
101 
102     string name;
103     string value;
104     bool signed;
105     @Condition("signed==true") string signature;
106 
107     mixin Make!(Endian.bigEndian, varuint);
108 
109     string toString()
110     {
111         return "Property(name: " ~ std.conv.to!string(this.name) ~ ", value: " ~ std.conv.to!string(this.value) ~ ", signed: " ~ std.conv.to!string(this.signed) ~ ", signature: " ~ std.conv.to!string(this.signature) ~ ")";
112     }
113 
114 }
115 
116 struct ListAddPlayer
117 {
118 
119     // gamemode
120     enum uint SURVIVAL = 0;
121     enum uint CREATIVE = 1;
122     enum uint ADVENTURE = 2;
123     enum uint SPECTATOR = 3;
124 
125     enum string[] __fields = ["uuid", "name", "properties", "gamemode", "latency", "hasDisplayName", "displayName"];
126 
127     UUID uuid;
128     string name;
129     soupply.java210.types.Property[] properties;
130     @Var uint gamemode;
131     @Var uint latency;
132     bool hasDisplayName;
133     @Condition("hasDisplayName==true") string displayName;
134 
135     mixin Make!(Endian.bigEndian, varuint);
136 
137     string toString()
138     {
139         return "ListAddPlayer(uuid: " ~ std.conv.to!string(this.uuid) ~ ", name: " ~ std.conv.to!string(this.name) ~ ", properties: " ~ std.conv.to!string(this.properties) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ", latency: " ~ std.conv.to!string(this.latency) ~ ", hasDisplayName: " ~ std.conv.to!string(this.hasDisplayName) ~ ", displayName: " ~ std.conv.to!string(this.displayName) ~ ")";
140     }
141 
142 }
143 
144 struct ListUpdateGamemode
145 {
146 
147     // gamemode
148     enum uint SURVIVAL = 0;
149     enum uint CREATIVE = 1;
150     enum uint ADVENTURE = 2;
151     enum uint SPECTATOR = 3;
152 
153     enum string[] __fields = ["uuid", "gamemode"];
154 
155     UUID uuid;
156     @Var uint gamemode;
157 
158     mixin Make!(Endian.bigEndian, varuint);
159 
160     string toString()
161     {
162         return "ListUpdateGamemode(uuid: " ~ std.conv.to!string(this.uuid) ~ ", gamemode: " ~ std.conv.to!string(this.gamemode) ~ ")";
163     }
164 
165 }
166 
167 struct ListUpdateLatency
168 {
169 
170     enum string[] __fields = ["uuid", "latency"];
171 
172     UUID uuid;
173     @Var uint latency;
174 
175     mixin Make!(Endian.bigEndian, varuint);
176 
177     string toString()
178     {
179         return "ListUpdateLatency(uuid: " ~ std.conv.to!string(this.uuid) ~ ", latency: " ~ std.conv.to!string(this.latency) ~ ")";
180     }
181 
182 }
183 
184 struct ListUpdateDisplayName
185 {
186 
187     enum string[] __fields = ["uuid", "hasDisplayName", "displayName"];
188 
189     UUID uuid;
190     bool hasDisplayName;
191     @Condition("hasDisplayName==true") string displayName;
192 
193     mixin Make!(Endian.bigEndian, varuint);
194 
195     string toString()
196     {
197         return "ListUpdateDisplayName(uuid: " ~ std.conv.to!string(this.uuid) ~ ", hasDisplayName: " ~ std.conv.to!string(this.hasDisplayName) ~ ", displayName: " ~ std.conv.to!string(this.displayName) ~ ")";
198     }
199 
200 }
201 
202 struct Modifier
203 {
204 
205     // operation
206     enum ubyte ADD_SUBSTRACT_AMOUNT = 0;
207     enum ubyte ADD_SUBSTRACT_AMOUNT_PERCENTAGE = 1;
208     enum ubyte MULTIPLY_AMOUNT_PERCENTAGE = 2;
209 
210     enum string[] __fields = ["uuid", "amount", "operation"];
211 
212     UUID uuid;
213     double amount;
214     ubyte operation;
215 
216     mixin Make!(Endian.bigEndian, varuint);
217 
218     string toString()
219     {
220         return "Modifier(uuid: " ~ std.conv.to!string(this.uuid) ~ ", amount: " ~ std.conv.to!string(this.amount) ~ ", operation: " ~ std.conv.to!string(this.operation) ~ ")";
221     }
222 
223 }
224 
225 struct Attribute
226 {
227 
228     enum string[] __fields = ["key", "value", "modifiers"];
229 
230     string key;
231     double value;
232     soupply.java210.types.Modifier[] modifiers;
233 
234     mixin Make!(Endian.bigEndian, varuint);
235 
236     string toString()
237     {
238         return "Attribute(key: " ~ std.conv.to!string(this.key) ~ ", value: " ~ std.conv.to!string(this.value) ~ ", modifiers: " ~ std.conv.to!string(this.modifiers) ~ ")";
239     }
240 
241 }
242 
243 struct OptionalPosition
244 {
245 
246     enum string[] __fields = ["hasPosition", "position"];
247 
248     bool hasPosition;
249     @Condition("hasPosition==true") ulong position;
250 
251     mixin Make!(Endian.bigEndian, varuint);
252 
253     string toString()
254     {
255         return "OptionalPosition(hasPosition: " ~ std.conv.to!string(this.hasPosition) ~ ", position: " ~ std.conv.to!string(this.position) ~ ")";
256     }
257 
258 }
259 
260 struct OptionalUuid
261 {
262 
263     enum string[] __fields = ["hasUuid", "uuid"];
264 
265     bool hasUuid;
266     UUID uuid;
267 
268     mixin Make!(Endian.bigEndian, varuint);
269 
270     string toString()
271     {
272         return "OptionalUuid(hasUuid: " ~ std.conv.to!string(this.hasUuid) ~ ", uuid: " ~ std.conv.to!string(this.uuid) ~ ")";
273     }
274 
275 }