...
1// <auto-generated>
2// automatically generated by the FlatBuffers compiler, do not modify
3// </auto-generated>
4
5namespace MyGame.Example
6{
7
8using global::System;
9using global::System.Collections.Generic;
10using global::Google.FlatBuffers;
11
12internal partial struct TestSimpleTableWithEnum : IFlatbufferObject
13{
14 private Table __p;
15 public ByteBuffer ByteBuffer { get { return __p.bb; } }
16 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); }
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 }
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 }
52}
53
54internal 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
64
65static public class TestSimpleTableWithEnumVerify
66{
67 static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
68 {
69 return verifier.VerifyTableStart(tablePos)
70 && verifier.VerifyField(tablePos, 4 /*Color*/, 1 /*MyGame.Example.Color*/, 1, false)
71 && verifier.VerifyTableEnd(tablePos);
72 }
73}
74
75}
View as plain text