1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 namespace MyGame.Example 4 { 5 6 using System; 7 using FlatBuffers; 8 9 public partial struct TestSimpleTableWithEnum : IFlatbufferObject 10 { 11 private Table __p; 12 public ByteBuffer ByteBuffer { get { return __p.bb; } } GetRootAsTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum13 public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } GetRootAsTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum14 public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } __initMyGame.Example.TestSimpleTableWithEnum15 public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; } __assignMyGame.Example.TestSimpleTableWithEnum16 public TestSimpleTableWithEnum __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 17 18 public Color Color { get { int o = __p.__offset(4); return o != 0 ? (Color)__p.bb.GetSbyte(o + __p.bb_pos) : Color.Green; } } MutateColorMyGame.Example.TestSimpleTableWithEnum19 public bool MutateColor(Color color) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, (sbyte)color); return true; } else { return false; } } 20 CreateTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum21 public static Offset<TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(FlatBufferBuilder builder, 22 Color color = Color.Green) { 23 builder.StartObject(1); 24 TestSimpleTableWithEnum.AddColor(builder, color); 25 return TestSimpleTableWithEnum.EndTestSimpleTableWithEnum(builder); 26 } 27 StartTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum28 public static void StartTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.StartObject(1); } AddColorMyGame.Example.TestSimpleTableWithEnum29 public static void AddColor(FlatBufferBuilder builder, Color color) { builder.AddSbyte(0, (sbyte)color, 2); } EndTestSimpleTableWithEnumMyGame.Example.TestSimpleTableWithEnum30 public static Offset<TestSimpleTableWithEnum> EndTestSimpleTableWithEnum(FlatBufferBuilder builder) { 31 int o = builder.EndObject(); 32 return new Offset<TestSimpleTableWithEnum>(o); 33 } 34 }; 35 36 37 } 38