source: binary-improvements2/WebServer/src/WebAPI/JsonCommons.cs@ 415

Last change on this file since 415 was 408, checked in by alloc, 21 months ago

Few pieces of code cleanup

File size: 818 bytes
Line 
1using Utf8Json;
2
3namespace Webserver.WebAPI {
4 public static class JsonCommons {
5 private static readonly byte[] jsonKeyPositionX = JsonWriter.GetEncodedPropertyNameWithBeginObject ("x");
6 private static readonly byte[] jsonKeyPositionY = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("y");
7 private static readonly byte[] jsonKeyPositionZ = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("z");
8
9 public static void WritePositionObject (ref JsonWriter _writer, Vector3i _position) {
10 _writer.WriteRaw (jsonKeyPositionX);
11 _writer.WriteInt32 (_position.x);
12
13 _writer.WriteRaw (jsonKeyPositionY);
14 _writer.WriteInt32 (_position.y);
15
16 _writer.WriteRaw (jsonKeyPositionZ);
17 _writer.WriteInt32 (_position.z);
18
19 _writer.WriteEndObject ();
20 }
21
22 }
23}
Note: See TracBrowser for help on using the repository browser.