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; |
| 9 | using global::FlatBuffers; |
| 10 | |
| 11 | public struct Stat : IFlatbufferObject |
| 12 | { |
| 13 | private Table __p; |
| 14 | public ByteBuffer ByteBuffer { get { return __p.bb; } } |
| 15 | public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); } |
| 16 | public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); } |
| 17 | public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } |
| 18 | public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } |
| 19 | public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 20 | |
| 21 | public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } |
| 22 | #if ENABLE_SPAN_T |
| 23 | public Span<byte> GetIdBytes() { return __p.__vector_as_span(4); } |
| 24 | #else |
| 25 | public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); } |
| 26 | #endif |
| 27 | public byte[] GetIdArray() { return __p.__vector_as_array<byte>(4); } |
| 28 | public long Val { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } |
| 29 | public bool MutateVal(long val) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, val); return true; } else { return false; } } |
| 30 | public ushort Count { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } } |
| 31 | public bool MutateCount(ushort count) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutUshort(o + __p.bb_pos, count); return true; } else { return false; } } |
| 32 | |
| 33 | public static Offset<MyGame.Example.Stat> CreateStat(FlatBufferBuilder builder, |
| 34 | StringOffset idOffset = default(StringOffset), |
| 35 | long val = 0, |
| 36 | ushort count = 0) { |
| 37 | builder.StartTable(3); |
| 38 | Stat.AddVal(builder, val); |
| 39 | Stat.AddId(builder, idOffset); |
| 40 | Stat.AddCount(builder, count); |
| 41 | return Stat.EndStat(builder); |
| 42 | } |
| 43 | |
| 44 | public static void StartStat(FlatBufferBuilder builder) { builder.StartTable(3); } |
| 45 | public static void AddId(FlatBufferBuilder builder, StringOffset idOffset) { builder.AddOffset(0, idOffset.Value, 0); } |
| 46 | public static void AddVal(FlatBufferBuilder builder, long val) { builder.AddLong(1, val, 0); } |
| 47 | public static void AddCount(FlatBufferBuilder builder, ushort count) { builder.AddUshort(2, count, 0); } |
| 48 | public static Offset<MyGame.Example.Stat> EndStat(FlatBufferBuilder builder) { |
| 49 | int o = builder.EndTable(); |
| 50 | return new Offset<MyGame.Example.Stat>(o); |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | |
| 55 | } |