blob: 6f19ed40bf64f28ab17b96233d5d7911095721e1 [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// <auto-generated>
2// automatically generated by the FlatBuffers compiler, do not modify
3// </auto-generated>
4
5namespace MyGame.Example
6{
7
8using global::System;
Austin Schuh272c6132020-11-14 16:37:52 -08009using global::System.Collections.Generic;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070010using global::FlatBuffers;
11
12public struct Stat : IFlatbufferObject
13{
14 private Table __p;
15 public ByteBuffer ByteBuffer { get { return __p.bb; } }
Austin Schuh272c6132020-11-14 16:37:52 -080016 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070017 public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
18 public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19 public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20 public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21
22 public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
23#if ENABLE_SPAN_T
Austin Schuh272c6132020-11-14 16:37:52 -080024 public Span<byte> GetIdBytes() { return __p.__vector_as_span<byte>(4, 1); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070025#else
26 public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); }
27#endif
28 public byte[] GetIdArray() { return __p.__vector_as_array<byte>(4); }
29 public long Val { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
30 public bool MutateVal(long val) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, val); return true; } else { return false; } }
31 public ushort Count { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
32 public bool MutateCount(ushort count) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutUshort(o + __p.bb_pos, count); return true; } else { return false; } }
33
34 public static Offset<MyGame.Example.Stat> CreateStat(FlatBufferBuilder builder,
35 StringOffset idOffset = default(StringOffset),
36 long val = 0,
37 ushort count = 0) {
38 builder.StartTable(3);
39 Stat.AddVal(builder, val);
40 Stat.AddId(builder, idOffset);
41 Stat.AddCount(builder, count);
42 return Stat.EndStat(builder);
43 }
44
45 public static void StartStat(FlatBufferBuilder builder) { builder.StartTable(3); }
46 public static void AddId(FlatBufferBuilder builder, StringOffset idOffset) { builder.AddOffset(0, idOffset.Value, 0); }
47 public static void AddVal(FlatBufferBuilder builder, long val) { builder.AddLong(1, val, 0); }
48 public static void AddCount(FlatBufferBuilder builder, ushort count) { builder.AddUshort(2, count, 0); }
49 public static Offset<MyGame.Example.Stat> EndStat(FlatBufferBuilder builder) {
50 int o = builder.EndTable();
51 return new Offset<MyGame.Example.Stat>(o);
52 }
Austin Schuh272c6132020-11-14 16:37:52 -080053 public StatT UnPack() {
54 var _o = new StatT();
55 this.UnPackTo(_o);
56 return _o;
57 }
58 public void UnPackTo(StatT _o) {
59 _o.Id = this.Id;
60 _o.Val = this.Val;
61 _o.Count = this.Count;
62 }
63 public static Offset<MyGame.Example.Stat> Pack(FlatBufferBuilder builder, StatT _o) {
64 if (_o == null) return default(Offset<MyGame.Example.Stat>);
65 var _id = _o.Id == null ? default(StringOffset) : builder.CreateString(_o.Id);
66 return CreateStat(
67 builder,
68 _id,
69 _o.Val,
70 _o.Count);
71 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070072};
73
Austin Schuh272c6132020-11-14 16:37:52 -080074public class StatT
75{
76 [Newtonsoft.Json.JsonProperty("id")]
77 public string Id { get; set; }
78 [Newtonsoft.Json.JsonProperty("val")]
79 public long Val { get; set; }
80 [Newtonsoft.Json.JsonProperty("count")]
81 public ushort Count { get; set; }
82
83 public StatT() {
84 this.Id = null;
85 this.Val = 0;
86 this.Count = 0;
87 }
88}
89
Austin Schuhe89fa2d2019-08-14 20:24:23 -070090
91}