Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 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; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 9 | using global::System.Collections.Generic; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 10 | using global::FlatBuffers; |
| 11 | |
| 12 | internal partial struct TestSimpleTableWithEnum : IFlatbufferObject |
| 13 | { |
| 14 | private Table __p; |
| 15 | public ByteBuffer ByteBuffer { get { return __p.bb; } } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 16 | public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 17 | public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } |
| 18 | public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum 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 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; } } |
| 23 | 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 | |
| 25 | 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 | |
| 32 | public static void StartTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.StartTable(1); } |
| 33 | public static void AddColor(FlatBufferBuilder builder, MyGame.Example.Color color) { builder.AddByte(0, (byte)color, 2); } |
| 34 | public static Offset<MyGame.Example.TestSimpleTableWithEnum> EndTestSimpleTableWithEnum(FlatBufferBuilder builder) { |
| 35 | int o = builder.EndTable(); |
| 36 | return new Offset<MyGame.Example.TestSimpleTableWithEnum>(o); |
| 37 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 38 | public TestSimpleTableWithEnumT UnPack() { |
| 39 | var _o = new TestSimpleTableWithEnumT(); |
| 40 | this.UnPackTo(_o); |
| 41 | return _o; |
| 42 | } |
| 43 | public void UnPackTo(TestSimpleTableWithEnumT _o) { |
| 44 | _o.Color = this.Color; |
| 45 | } |
| 46 | 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 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 54 | internal partial class TestSimpleTableWithEnumT |
| 55 | { |
| 56 | [Newtonsoft.Json.JsonProperty("color")] |
| 57 | public MyGame.Example.Color Color { get; set; } |
| 58 | |
| 59 | public TestSimpleTableWithEnumT() { |
| 60 | this.Color = MyGame.Example.Color.Green; |
| 61 | } |
| 62 | } |
| 63 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 64 | |
| 65 | } |