• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 struct Stat : IFlatbufferObject
10 {
11   private Table __p;
12   public ByteBuffer ByteBuffer { get { return __p.bb; } }
GetRootAsStatMyGame.Example.Stat13   public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
GetRootAsStatMyGame.Example.Stat14   public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
__initMyGame.Example.Stat15   public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
__assignMyGame.Example.Stat16   public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
17 
18   public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
GetIdBytesMyGame.Example.Stat19   public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); }
20   public long Val { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
MutateValMyGame.Example.Stat21   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; } }
22   public ushort Count { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
MutateCountMyGame.Example.Stat23   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; } }
24 
CreateStatMyGame.Example.Stat25   public static Offset<Stat> CreateStat(FlatBufferBuilder builder,
26       StringOffset idOffset = default(StringOffset),
27       long val = 0,
28       ushort count = 0) {
29     builder.StartObject(3);
30     Stat.AddVal(builder, val);
31     Stat.AddId(builder, idOffset);
32     Stat.AddCount(builder, count);
33     return Stat.EndStat(builder);
34   }
35 
StartStatMyGame.Example.Stat36   public static void StartStat(FlatBufferBuilder builder) { builder.StartObject(3); }
AddIdMyGame.Example.Stat37   public static void AddId(FlatBufferBuilder builder, StringOffset idOffset) { builder.AddOffset(0, idOffset.Value, 0); }
AddValMyGame.Example.Stat38   public static void AddVal(FlatBufferBuilder builder, long val) { builder.AddLong(1, val, 0); }
AddCountMyGame.Example.Stat39   public static void AddCount(FlatBufferBuilder builder, ushort count) { builder.AddUshort(2, count, 0); }
EndStatMyGame.Example.Stat40   public static Offset<Stat> EndStat(FlatBufferBuilder builder) {
41     int o = builder.EndObject();
42     return new Offset<Stat>(o);
43   }
44 };
45 
46 
47 }
48