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 TypeAliases : IFlatbufferObject 13 { 14 private Table __p; 15 public ByteBuffer ByteBuffer { get { return __p.bb; } } ValidateVersionMyGame.Example.TypeAliases16 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); } GetRootAsTypeAliasesMyGame.Example.TypeAliases17 public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); } GetRootAsTypeAliasesMyGame.Example.TypeAliases18 public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } __initMyGame.Example.TypeAliases19 public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } __assignMyGame.Example.TypeAliases20 public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 21 22 public sbyte I8 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } } MutateI8MyGame.Example.TypeAliases23 public bool MutateI8(sbyte i8) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, i8); return true; } else { return false; } } 24 public byte U8 { get { int o = __p.__offset(6); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte)0; } } MutateU8MyGame.Example.TypeAliases25 public bool MutateU8(byte u8) { int o = __p.__offset(6); if (o != 0) { __p.bb.Put(o + __p.bb_pos, u8); return true; } else { return false; } } 26 public short I16 { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } } MutateI16MyGame.Example.TypeAliases27 public bool MutateI16(short i16) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutShort(o + __p.bb_pos, i16); return true; } else { return false; } } 28 public ushort U16 { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } } MutateU16MyGame.Example.TypeAliases29 public bool MutateU16(ushort u16) { int o = __p.__offset(10); if (o != 0) { __p.bb.PutUshort(o + __p.bb_pos, u16); return true; } else { return false; } } 30 public int I32 { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } MutateI32MyGame.Example.TypeAliases31 public bool MutateI32(int i32) { int o = __p.__offset(12); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, i32); return true; } else { return false; } } 32 public uint U32 { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } MutateU32MyGame.Example.TypeAliases33 public bool MutateU32(uint u32) { int o = __p.__offset(14); if (o != 0) { __p.bb.PutUint(o + __p.bb_pos, u32); return true; } else { return false; } } 34 public long I64 { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } MutateI64MyGame.Example.TypeAliases35 public bool MutateI64(long i64) { int o = __p.__offset(16); if (o != 0) { __p.bb.PutLong(o + __p.bb_pos, i64); return true; } else { return false; } } 36 public ulong U64 { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)0; } } MutateU64MyGame.Example.TypeAliases37 public bool MutateU64(ulong u64) { int o = __p.__offset(18); if (o != 0) { __p.bb.PutUlong(o + __p.bb_pos, u64); return true; } else { return false; } } 38 public float F32 { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } } MutateF32MyGame.Example.TypeAliases39 public bool MutateF32(float f32) { int o = __p.__offset(20); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f32); return true; } else { return false; } } 40 public double F64 { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)0.0; } } MutateF64MyGame.Example.TypeAliases41 public bool MutateF64(double f64) { int o = __p.__offset(22); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, f64); return true; } else { return false; } } V8MyGame.Example.TypeAliases42 public sbyte V8(int j) { int o = __p.__offset(24); return o != 0 ? __p.bb.GetSbyte(__p.__vector(o) + j * 1) : (sbyte)0; } 43 public int V8Length { get { int o = __p.__offset(24); return o != 0 ? __p.__vector_len(o) : 0; } } 44 #if ENABLE_SPAN_T GetV8BytesMyGame.Example.TypeAliases45 public Span<sbyte> GetV8Bytes() { return __p.__vector_as_span<sbyte>(24, 1); } 46 #else GetV8BytesMyGame.Example.TypeAliases47 public ArraySegment<byte>? GetV8Bytes() { return __p.__vector_as_arraysegment(24); } 48 #endif GetV8ArrayMyGame.Example.TypeAliases49 public sbyte[] GetV8Array() { return __p.__vector_as_array<sbyte>(24); } MutateV8MyGame.Example.TypeAliases50 public bool MutateV8(int j, sbyte v8) { int o = __p.__offset(24); if (o != 0) { __p.bb.PutSbyte(__p.__vector(o) + j * 1, v8); return true; } else { return false; } } Vf64MyGame.Example.TypeAliases51 public double Vf64(int j) { int o = __p.__offset(26); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; } 52 public int Vf64Length { get { int o = __p.__offset(26); return o != 0 ? __p.__vector_len(o) : 0; } } 53 #if ENABLE_SPAN_T GetVf64BytesMyGame.Example.TypeAliases54 public Span<double> GetVf64Bytes() { return __p.__vector_as_span<double>(26, 8); } 55 #else GetVf64BytesMyGame.Example.TypeAliases56 public ArraySegment<byte>? GetVf64Bytes() { return __p.__vector_as_arraysegment(26); } 57 #endif GetVf64ArrayMyGame.Example.TypeAliases58 public double[] GetVf64Array() { return __p.__vector_as_array<double>(26); } MutateVf64MyGame.Example.TypeAliases59 public bool MutateVf64(int j, double vf64) { int o = __p.__offset(26); if (o != 0) { __p.bb.PutDouble(__p.__vector(o) + j * 8, vf64); return true; } else { return false; } } 60 CreateTypeAliasesMyGame.Example.TypeAliases61 public static Offset<MyGame.Example.TypeAliases> CreateTypeAliases(FlatBufferBuilder builder, 62 sbyte i8 = 0, 63 byte u8 = 0, 64 short i16 = 0, 65 ushort u16 = 0, 66 int i32 = 0, 67 uint u32 = 0, 68 long i64 = 0, 69 ulong u64 = 0, 70 float f32 = 0.0f, 71 double f64 = 0.0, 72 VectorOffset v8Offset = default(VectorOffset), 73 VectorOffset vf64Offset = default(VectorOffset)) { 74 builder.StartTable(12); 75 TypeAliases.AddF64(builder, f64); 76 TypeAliases.AddU64(builder, u64); 77 TypeAliases.AddI64(builder, i64); 78 TypeAliases.AddVf64(builder, vf64Offset); 79 TypeAliases.AddV8(builder, v8Offset); 80 TypeAliases.AddF32(builder, f32); 81 TypeAliases.AddU32(builder, u32); 82 TypeAliases.AddI32(builder, i32); 83 TypeAliases.AddU16(builder, u16); 84 TypeAliases.AddI16(builder, i16); 85 TypeAliases.AddU8(builder, u8); 86 TypeAliases.AddI8(builder, i8); 87 return TypeAliases.EndTypeAliases(builder); 88 } 89 StartTypeAliasesMyGame.Example.TypeAliases90 public static void StartTypeAliases(FlatBufferBuilder builder) { builder.StartTable(12); } AddI8MyGame.Example.TypeAliases91 public static void AddI8(FlatBufferBuilder builder, sbyte i8) { builder.AddSbyte(0, i8, 0); } AddU8MyGame.Example.TypeAliases92 public static void AddU8(FlatBufferBuilder builder, byte u8) { builder.AddByte(1, u8, 0); } AddI16MyGame.Example.TypeAliases93 public static void AddI16(FlatBufferBuilder builder, short i16) { builder.AddShort(2, i16, 0); } AddU16MyGame.Example.TypeAliases94 public static void AddU16(FlatBufferBuilder builder, ushort u16) { builder.AddUshort(3, u16, 0); } AddI32MyGame.Example.TypeAliases95 public static void AddI32(FlatBufferBuilder builder, int i32) { builder.AddInt(4, i32, 0); } AddU32MyGame.Example.TypeAliases96 public static void AddU32(FlatBufferBuilder builder, uint u32) { builder.AddUint(5, u32, 0); } AddI64MyGame.Example.TypeAliases97 public static void AddI64(FlatBufferBuilder builder, long i64) { builder.AddLong(6, i64, 0); } AddU64MyGame.Example.TypeAliases98 public static void AddU64(FlatBufferBuilder builder, ulong u64) { builder.AddUlong(7, u64, 0); } AddF32MyGame.Example.TypeAliases99 public static void AddF32(FlatBufferBuilder builder, float f32) { builder.AddFloat(8, f32, 0.0f); } AddF64MyGame.Example.TypeAliases100 public static void AddF64(FlatBufferBuilder builder, double f64) { builder.AddDouble(9, f64, 0.0); } AddV8MyGame.Example.TypeAliases101 public static void AddV8(FlatBufferBuilder builder, VectorOffset v8Offset) { builder.AddOffset(10, v8Offset.Value, 0); } CreateV8VectorMyGame.Example.TypeAliases102 public static VectorOffset CreateV8Vector(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte(data[i]); return builder.EndVector(); } CreateV8VectorBlockMyGame.Example.TypeAliases103 public static VectorOffset CreateV8VectorBlock(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); } StartV8VectorMyGame.Example.TypeAliases104 public static void StartV8Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); } AddVf64MyGame.Example.TypeAliases105 public static void AddVf64(FlatBufferBuilder builder, VectorOffset vf64Offset) { builder.AddOffset(11, vf64Offset.Value, 0); } CreateVf64VectorMyGame.Example.TypeAliases106 public static VectorOffset CreateVf64Vector(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddDouble(data[i]); return builder.EndVector(); } CreateVf64VectorBlockMyGame.Example.TypeAliases107 public static VectorOffset CreateVf64VectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } StartVf64VectorMyGame.Example.TypeAliases108 public static void StartVf64Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } EndTypeAliasesMyGame.Example.TypeAliases109 public static Offset<MyGame.Example.TypeAliases> EndTypeAliases(FlatBufferBuilder builder) { 110 int o = builder.EndTable(); 111 return new Offset<MyGame.Example.TypeAliases>(o); 112 } UnPackMyGame.Example.TypeAliases113 public TypeAliasesT UnPack() { 114 var _o = new TypeAliasesT(); 115 this.UnPackTo(_o); 116 return _o; 117 } UnPackToMyGame.Example.TypeAliases118 public void UnPackTo(TypeAliasesT _o) { 119 _o.I8 = this.I8; 120 _o.U8 = this.U8; 121 _o.I16 = this.I16; 122 _o.U16 = this.U16; 123 _o.I32 = this.I32; 124 _o.U32 = this.U32; 125 _o.I64 = this.I64; 126 _o.U64 = this.U64; 127 _o.F32 = this.F32; 128 _o.F64 = this.F64; 129 _o.V8 = new List<sbyte>(); 130 for (var _j = 0; _j < this.V8Length; ++_j) {_o.V8.Add(this.V8(_j));} 131 _o.Vf64 = new List<double>(); 132 for (var _j = 0; _j < this.Vf64Length; ++_j) {_o.Vf64.Add(this.Vf64(_j));} 133 } PackMyGame.Example.TypeAliases134 public static Offset<MyGame.Example.TypeAliases> Pack(FlatBufferBuilder builder, TypeAliasesT _o) { 135 if (_o == null) return default(Offset<MyGame.Example.TypeAliases>); 136 var _v8 = default(VectorOffset); 137 if (_o.V8 != null) { 138 var __v8 = _o.V8.ToArray(); 139 _v8 = CreateV8Vector(builder, __v8); 140 } 141 var _vf64 = default(VectorOffset); 142 if (_o.Vf64 != null) { 143 var __vf64 = _o.Vf64.ToArray(); 144 _vf64 = CreateVf64Vector(builder, __vf64); 145 } 146 return CreateTypeAliases( 147 builder, 148 _o.I8, 149 _o.U8, 150 _o.I16, 151 _o.U16, 152 _o.I32, 153 _o.U32, 154 _o.I64, 155 _o.U64, 156 _o.F32, 157 _o.F64, 158 _v8, 159 _vf64); 160 } 161 }; 162 163 public class TypeAliasesT 164 { 165 [Newtonsoft.Json.JsonProperty("i8")] 166 public sbyte I8 { get; set; } 167 [Newtonsoft.Json.JsonProperty("u8")] 168 public byte U8 { get; set; } 169 [Newtonsoft.Json.JsonProperty("i16")] 170 public short I16 { get; set; } 171 [Newtonsoft.Json.JsonProperty("u16")] 172 public ushort U16 { get; set; } 173 [Newtonsoft.Json.JsonProperty("i32")] 174 public int I32 { get; set; } 175 [Newtonsoft.Json.JsonProperty("u32")] 176 public uint U32 { get; set; } 177 [Newtonsoft.Json.JsonProperty("i64")] 178 public long I64 { get; set; } 179 [Newtonsoft.Json.JsonProperty("u64")] 180 public ulong U64 { get; set; } 181 [Newtonsoft.Json.JsonProperty("f32")] 182 public float F32 { get; set; } 183 [Newtonsoft.Json.JsonProperty("f64")] 184 public double F64 { get; set; } 185 [Newtonsoft.Json.JsonProperty("v8")] 186 public List<sbyte> V8 { get; set; } 187 [Newtonsoft.Json.JsonProperty("vf64")] 188 public List<double> Vf64 { get; set; } 189 TypeAliasesT()190 public TypeAliasesT() { 191 this.I8 = 0; 192 this.U8 = 0; 193 this.I16 = 0; 194 this.U16 = 0; 195 this.I32 = 0; 196 this.U32 = 0; 197 this.I64 = 0; 198 this.U64 = 0; 199 this.F32 = 0.0f; 200 this.F64 = 0.0; 201 this.V8 = null; 202 this.Vf64 = null; 203 } 204 } 205 206 207 } 208