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 internal partial struct TestSimpleTableWithEnum : IFlatbufferObject
13 {
14   private Table __p;
15   public ByteBuffer ByteBuffer { get { return __p.bb; } }
ValidateVersionMyGame.Example.TestSimpleTableWithEnum16   public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_0(); }
GetRootAsTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum17   public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); }
GetRootAsTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum18   public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
__initMyGame.Example.TestSimpleTableWithEnum19   public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
__assignMyGame.Example.TestSimpleTableWithEnum20   public TestSimpleTableWithEnum __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21 
22   public MyGame.Example.Color Color { get { int o = __p.__offset(4); return o != 0 ? (MyGame.Example.Color)__p.bb.Get(o + __p.bb_pos) : MyGame.Example.Color.Green; } }
MutateColorMyGame.Example.TestSimpleTableWithEnum23   public bool MutateColor(MyGame.Example.Color color) { int o = __p.__offset(4); if (o != 0) { __p.bb.Put(o + __p.bb_pos, (byte)color); return true; } else { return false; } }
24 
CreateTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum25   public static Offset<MyGame.Example.TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(FlatBufferBuilder builder,
26       MyGame.Example.Color color = MyGame.Example.Color.Green) {
27     builder.StartTable(1);
28     TestSimpleTableWithEnum.AddColor(builder, color);
29     return TestSimpleTableWithEnum.EndTestSimpleTableWithEnum(builder);
30   }
31 
StartTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum32   public static void StartTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.StartTable(1); }
AddColorMyGame.Example.TestSimpleTableWithEnum33   public static void AddColor(FlatBufferBuilder builder, MyGame.Example.Color color) { builder.AddByte(0, (byte)color, 2); }
EndTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum34   public static Offset<MyGame.Example.TestSimpleTableWithEnum> EndTestSimpleTableWithEnum(FlatBufferBuilder builder) {
35     int o = builder.EndTable();
36     return new Offset<MyGame.Example.TestSimpleTableWithEnum>(o);
37   }
UnPackMyGame.Example.TestSimpleTableWithEnum38   public TestSimpleTableWithEnumT UnPack() {
39     var _o = new TestSimpleTableWithEnumT();
40     this.UnPackTo(_o);
41     return _o;
42   }
UnPackToMyGame.Example.TestSimpleTableWithEnum43   public void UnPackTo(TestSimpleTableWithEnumT _o) {
44     _o.Color = this.Color;
45   }
PackMyGame.Example.TestSimpleTableWithEnum46   public static Offset<MyGame.Example.TestSimpleTableWithEnum> Pack(FlatBufferBuilder builder, TestSimpleTableWithEnumT _o) {
47     if (_o == null) return default(Offset<MyGame.Example.TestSimpleTableWithEnum>);
48     return CreateTestSimpleTableWithEnum(
49       builder,
50       _o.Color);
51   }
52 };
53 
54 internal partial class TestSimpleTableWithEnumT
55 {
56   [Newtonsoft.Json.JsonProperty("color")]
57   public MyGame.Example.Color Color { get; set; }
58 
TestSimpleTableWithEnumT()59   public TestSimpleTableWithEnumT() {
60     this.Color = MyGame.Example.Color.Green;
61   }
62 }
63 
64 
65 }
66