1 // <auto-generated>
2 //  automatically generated by the FlatBuffers compiler, do not modify
3 // </auto-generated>
4 
5 namespace MyGame.Example
6 {
7 
8 using global::System;
9 using global::System.Collections.Generic;
10 using global::FlatBuffers;
11 
12 public struct ArrayTable : IFlatbufferObject
13 {
14   private Table __p;
15   public ByteBuffer ByteBuffer { get { return __p.bb; } }
ValidateVersionMyGame.Example.ArrayTable16   public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
GetRootAsArrayTableMyGame.Example.ArrayTable17   public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb) { return GetRootAsArrayTable(_bb, new ArrayTable()); }
GetRootAsArrayTableMyGame.Example.ArrayTable18   public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
ArrayTableBufferHasIdentifierMyGame.Example.ArrayTable19   public static bool ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "ARRT"); }
__initMyGame.Example.ArrayTable20   public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
__assignMyGame.Example.ArrayTable21   public ArrayTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
22 
23   public MyGame.Example.ArrayStruct? A { get { int o = __p.__offset(4); return o != 0 ? (MyGame.Example.ArrayStruct?)(new MyGame.Example.ArrayStruct()).__assign(o + __p.bb_pos, __p.bb) : null; } }
24 
StartArrayTableMyGame.Example.ArrayTable25   public static void StartArrayTable(FlatBufferBuilder builder) { builder.StartTable(1); }
AddAMyGame.Example.ArrayTable26   public static void AddA(FlatBufferBuilder builder, Offset<MyGame.Example.ArrayStruct> aOffset) { builder.AddStruct(0, aOffset.Value, 0); }
EndArrayTableMyGame.Example.ArrayTable27   public static Offset<MyGame.Example.ArrayTable> EndArrayTable(FlatBufferBuilder builder) {
28     int o = builder.EndTable();
29     return new Offset<MyGame.Example.ArrayTable>(o);
30   }
FinishArrayTableBufferMyGame.Example.ArrayTable31   public static void FinishArrayTableBuffer(FlatBufferBuilder builder, Offset<MyGame.Example.ArrayTable> offset) { builder.Finish(offset.Value, "ARRT"); }
FinishSizePrefixedArrayTableBufferMyGame.Example.ArrayTable32   public static void FinishSizePrefixedArrayTableBuffer(FlatBufferBuilder builder, Offset<MyGame.Example.ArrayTable> offset) { builder.FinishSizePrefixed(offset.Value, "ARRT"); }
UnPackMyGame.Example.ArrayTable33   public ArrayTableT UnPack() {
34     var _o = new ArrayTableT();
35     this.UnPackTo(_o);
36     return _o;
37   }
UnPackToMyGame.Example.ArrayTable38   public void UnPackTo(ArrayTableT _o) {
39     _o.A = this.A.HasValue ? this.A.Value.UnPack() : null;
40   }
PackMyGame.Example.ArrayTable41   public static Offset<MyGame.Example.ArrayTable> Pack(FlatBufferBuilder builder, ArrayTableT _o) {
42     if (_o == null) return default(Offset<MyGame.Example.ArrayTable>);
43     StartArrayTable(builder);
44     AddA(builder, MyGame.Example.ArrayStruct.Pack(builder, _o.A));
45     return EndArrayTable(builder);
46   }
47 };
48 
49 public class ArrayTableT
50 {
51   [Newtonsoft.Json.JsonProperty("a")]
52   public MyGame.Example.ArrayStructT A { get; set; }
53 
ArrayTableT()54   public ArrayTableT() {
55     this.A = new MyGame.Example.ArrayStructT();
56   }
57 
DeserializeFromJson(string jsonText)58   public static ArrayTableT DeserializeFromJson(string jsonText) {
59     return Newtonsoft.Json.JsonConvert.DeserializeObject<ArrayTableT>(jsonText);
60   }
SerializeToJson()61   public string SerializeToJson() {
62     return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
63   }
DeserializeFromBinary(byte[] fbBuffer)64   public static ArrayTableT DeserializeFromBinary(byte[] fbBuffer) {
65     return ArrayTable.GetRootAsArrayTable(new ByteBuffer(fbBuffer)).UnPack();
66   }
SerializeToBinary()67   public byte[] SerializeToBinary() {
68     var fbb = new FlatBufferBuilder(0x10000);
69     fbb.Finish(ArrayTable.Pack(fbb, this).Value);
70     return fbb.DataBuffer.ToSizedArray();
71   }
72 }
73 
74 
75 }
76