• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 public struct Stat : IFlatbufferObject
13 {
14   private Table __p;
15   public ByteBuffer ByteBuffer { get { return __p.bb; } }
ValidateVersionMyGame.Example.Stat16   public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
GetRootAsStatMyGame.Example.Stat17   public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
GetRootAsStatMyGame.Example.Stat18   public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
__initMyGame.Example.Stat19   public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
__assignMyGame.Example.Stat20   public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21 
22   public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
23 #if ENABLE_SPAN_T
GetIdBytesMyGame.Example.Stat24   public Span<byte> GetIdBytes() { return __p.__vector_as_span<byte>(4, 1); }
25 #else
GetIdBytesMyGame.Example.Stat26   public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); }
27 #endif
GetIdArrayMyGame.Example.Stat28   public byte[] GetIdArray() { return __p.__vector_as_array<byte>(4); }
29   public long Val { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
MutateValMyGame.Example.Stat30   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; } }
31   public ushort Count { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
MutateCountMyGame.Example.Stat32   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; } }
33 
CreateStatMyGame.Example.Stat34   public static Offset<MyGame.Example.Stat> CreateStat(FlatBufferBuilder builder,
35       StringOffset idOffset = default(StringOffset),
36       long val = 0,
37       ushort count = 0) {
38     builder.StartTable(3);
39     Stat.AddVal(builder, val);
40     Stat.AddId(builder, idOffset);
41     Stat.AddCount(builder, count);
42     return Stat.EndStat(builder);
43   }
44 
StartStatMyGame.Example.Stat45   public static void StartStat(FlatBufferBuilder builder) { builder.StartTable(3); }
AddIdMyGame.Example.Stat46   public static void AddId(FlatBufferBuilder builder, StringOffset idOffset) { builder.AddOffset(0, idOffset.Value, 0); }
AddValMyGame.Example.Stat47   public static void AddVal(FlatBufferBuilder builder, long val) { builder.AddLong(1, val, 0); }
AddCountMyGame.Example.Stat48   public static void AddCount(FlatBufferBuilder builder, ushort count) { builder.AddUshort(2, count, 0); }
EndStatMyGame.Example.Stat49   public static Offset<MyGame.Example.Stat> EndStat(FlatBufferBuilder builder) {
50     int o = builder.EndTable();
51     return new Offset<MyGame.Example.Stat>(o);
52   }
UnPackMyGame.Example.Stat53   public StatT UnPack() {
54     var _o = new StatT();
55     this.UnPackTo(_o);
56     return _o;
57   }
UnPackToMyGame.Example.Stat58   public void UnPackTo(StatT _o) {
59     _o.Id = this.Id;
60     _o.Val = this.Val;
61     _o.Count = this.Count;
62   }
PackMyGame.Example.Stat63   public static Offset<MyGame.Example.Stat> Pack(FlatBufferBuilder builder, StatT _o) {
64     if (_o == null) return default(Offset<MyGame.Example.Stat>);
65     var _id = _o.Id == null ? default(StringOffset) : builder.CreateString(_o.Id);
66     return CreateStat(
67       builder,
68       _id,
69       _o.Val,
70       _o.Count);
71   }
72 };
73 
74 public class StatT
75 {
76   [Newtonsoft.Json.JsonProperty("id")]
77   public string Id { get; set; }
78   [Newtonsoft.Json.JsonProperty("val")]
79   public long Val { get; set; }
80   [Newtonsoft.Json.JsonProperty("count")]
81   public ushort Count { get; set; }
82 
StatT()83   public StatT() {
84     this.Id = null;
85     this.Val = 0;
86     this.Count = 0;
87   }
88 }
89 
90 
91 }
92