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 |
| 6 | { |
| 7 | |
| 8 | using global::System; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 9 | using global::System.Collections.Generic; |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 10 | using global::Google.FlatBuffers; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 11 | |
| 12 | public struct MonsterExtra : IFlatbufferObject |
| 13 | { |
| 14 | private Table __p; |
| 15 | public ByteBuffer ByteBuffer { get { return __p.bb; } } |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 16 | public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_22_10_26(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 17 | public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb) { return GetRootAsMonsterExtra(_bb, new MonsterExtra()); } |
| 18 | public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } |
| 19 | public static bool MonsterExtraBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONE"); } |
| 20 | public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } |
| 21 | public MonsterExtra __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 22 | |
| 23 | public double D0 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)Double.NaN; } } |
| 24 | public bool MutateD0(double d0) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, d0); return true; } else { return false; } } |
| 25 | public double D1 { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)Double.NaN; } } |
| 26 | public bool MutateD1(double d1) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, d1); return true; } else { return false; } } |
| 27 | public double D2 { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)Double.PositiveInfinity; } } |
| 28 | public bool MutateD2(double d2) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, d2); return true; } else { return false; } } |
| 29 | public double D3 { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)Double.NegativeInfinity; } } |
| 30 | public bool MutateD3(double d3) { int o = __p.__offset(10); if (o != 0) { __p.bb.PutDouble(o + __p.bb_pos, d3); return true; } else { return false; } } |
| 31 | public float F0 { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)Single.NaN; } } |
| 32 | public bool MutateF0(float f0) { int o = __p.__offset(12); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f0); return true; } else { return false; } } |
| 33 | public float F1 { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)Single.NaN; } } |
| 34 | public bool MutateF1(float f1) { int o = __p.__offset(14); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f1); return true; } else { return false; } } |
| 35 | public float F2 { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)Single.PositiveInfinity; } } |
| 36 | public bool MutateF2(float f2) { int o = __p.__offset(16); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f2); return true; } else { return false; } } |
| 37 | public float F3 { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)Single.NegativeInfinity; } } |
| 38 | public bool MutateF3(float f3) { int o = __p.__offset(18); if (o != 0) { __p.bb.PutFloat(o + __p.bb_pos, f3); return true; } else { return false; } } |
| 39 | public double Dvec(int j) { int o = __p.__offset(20); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; } |
| 40 | public int DvecLength { get { int o = __p.__offset(20); return o != 0 ? __p.__vector_len(o) : 0; } } |
| 41 | #if ENABLE_SPAN_T |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 42 | public Span<double> GetDvecBytes() { return __p.__vector_as_span<double>(20, 8); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 43 | #else |
| 44 | public ArraySegment<byte>? GetDvecBytes() { return __p.__vector_as_arraysegment(20); } |
| 45 | #endif |
| 46 | public double[] GetDvecArray() { return __p.__vector_as_array<double>(20); } |
| 47 | public bool MutateDvec(int j, double dvec) { int o = __p.__offset(20); if (o != 0) { __p.bb.PutDouble(__p.__vector(o) + j * 8, dvec); return true; } else { return false; } } |
| 48 | public float Fvec(int j) { int o = __p.__offset(22); return o != 0 ? __p.bb.GetFloat(__p.__vector(o) + j * 4) : (float)0; } |
| 49 | public int FvecLength { get { int o = __p.__offset(22); return o != 0 ? __p.__vector_len(o) : 0; } } |
| 50 | #if ENABLE_SPAN_T |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 51 | public Span<float> GetFvecBytes() { return __p.__vector_as_span<float>(22, 4); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 52 | #else |
| 53 | public ArraySegment<byte>? GetFvecBytes() { return __p.__vector_as_arraysegment(22); } |
| 54 | #endif |
| 55 | public float[] GetFvecArray() { return __p.__vector_as_array<float>(22); } |
| 56 | public bool MutateFvec(int j, float fvec) { int o = __p.__offset(22); if (o != 0) { __p.bb.PutFloat(__p.__vector(o) + j * 4, fvec); return true; } else { return false; } } |
| 57 | |
| 58 | public static Offset<MyGame.MonsterExtra> CreateMonsterExtra(FlatBufferBuilder builder, |
| 59 | double d0 = Double.NaN, |
| 60 | double d1 = Double.NaN, |
| 61 | double d2 = Double.PositiveInfinity, |
| 62 | double d3 = Double.NegativeInfinity, |
| 63 | float f0 = Single.NaN, |
| 64 | float f1 = Single.NaN, |
| 65 | float f2 = Single.PositiveInfinity, |
| 66 | float f3 = Single.NegativeInfinity, |
| 67 | VectorOffset dvecOffset = default(VectorOffset), |
| 68 | VectorOffset fvecOffset = default(VectorOffset)) { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 69 | builder.StartTable(11); |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 70 | MonsterExtra.AddD3(builder, d3); |
| 71 | MonsterExtra.AddD2(builder, d2); |
| 72 | MonsterExtra.AddD1(builder, d1); |
| 73 | MonsterExtra.AddD0(builder, d0); |
| 74 | MonsterExtra.AddFvec(builder, fvecOffset); |
| 75 | MonsterExtra.AddDvec(builder, dvecOffset); |
| 76 | MonsterExtra.AddF3(builder, f3); |
| 77 | MonsterExtra.AddF2(builder, f2); |
| 78 | MonsterExtra.AddF1(builder, f1); |
| 79 | MonsterExtra.AddF0(builder, f0); |
| 80 | return MonsterExtra.EndMonsterExtra(builder); |
| 81 | } |
| 82 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 83 | public static void StartMonsterExtra(FlatBufferBuilder builder) { builder.StartTable(11); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 84 | public static void AddD0(FlatBufferBuilder builder, double d0) { builder.AddDouble(0, d0, Double.NaN); } |
| 85 | public static void AddD1(FlatBufferBuilder builder, double d1) { builder.AddDouble(1, d1, Double.NaN); } |
| 86 | public static void AddD2(FlatBufferBuilder builder, double d2) { builder.AddDouble(2, d2, Double.PositiveInfinity); } |
| 87 | public static void AddD3(FlatBufferBuilder builder, double d3) { builder.AddDouble(3, d3, Double.NegativeInfinity); } |
| 88 | public static void AddF0(FlatBufferBuilder builder, float f0) { builder.AddFloat(4, f0, Single.NaN); } |
| 89 | public static void AddF1(FlatBufferBuilder builder, float f1) { builder.AddFloat(5, f1, Single.NaN); } |
| 90 | public static void AddF2(FlatBufferBuilder builder, float f2) { builder.AddFloat(6, f2, Single.PositiveInfinity); } |
| 91 | public static void AddF3(FlatBufferBuilder builder, float f3) { builder.AddFloat(7, f3, Single.NegativeInfinity); } |
| 92 | public static void AddDvec(FlatBufferBuilder builder, VectorOffset dvecOffset) { builder.AddOffset(8, dvecOffset.Value, 0); } |
| 93 | public static VectorOffset CreateDvecVector(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(); } |
| 94 | public static VectorOffset CreateDvecVectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 95 | public static VectorOffset CreateDvecVectorBlock(FlatBufferBuilder builder, ArraySegment<double> data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } |
| 96 | public static VectorOffset CreateDvecVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<double>(dataPtr, sizeInBytes); return builder.EndVector(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 97 | public static void StartDvecVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } |
| 98 | public static void AddFvec(FlatBufferBuilder builder, VectorOffset fvecOffset) { builder.AddOffset(9, fvecOffset.Value, 0); } |
| 99 | public static VectorOffset CreateFvecVector(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddFloat(data[i]); return builder.EndVector(); } |
| 100 | public static VectorOffset CreateFvecVectorBlock(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } |
Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 101 | public static VectorOffset CreateFvecVectorBlock(FlatBufferBuilder builder, ArraySegment<float> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } |
| 102 | public static VectorOffset CreateFvecVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<float>(dataPtr, sizeInBytes); return builder.EndVector(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 103 | public static void StartFvecVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } |
| 104 | public static Offset<MyGame.MonsterExtra> EndMonsterExtra(FlatBufferBuilder builder) { |
| 105 | int o = builder.EndTable(); |
| 106 | return new Offset<MyGame.MonsterExtra>(o); |
| 107 | } |
| 108 | public static void FinishMonsterExtraBuffer(FlatBufferBuilder builder, Offset<MyGame.MonsterExtra> offset) { builder.Finish(offset.Value, "MONE"); } |
| 109 | public static void FinishSizePrefixedMonsterExtraBuffer(FlatBufferBuilder builder, Offset<MyGame.MonsterExtra> offset) { builder.FinishSizePrefixed(offset.Value, "MONE"); } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 110 | public MonsterExtraT UnPack() { |
| 111 | var _o = new MonsterExtraT(); |
| 112 | this.UnPackTo(_o); |
| 113 | return _o; |
| 114 | } |
| 115 | public void UnPackTo(MonsterExtraT _o) { |
| 116 | _o.D0 = this.D0; |
| 117 | _o.D1 = this.D1; |
| 118 | _o.D2 = this.D2; |
| 119 | _o.D3 = this.D3; |
| 120 | _o.F0 = this.F0; |
| 121 | _o.F1 = this.F1; |
| 122 | _o.F2 = this.F2; |
| 123 | _o.F3 = this.F3; |
| 124 | _o.Dvec = new List<double>(); |
| 125 | for (var _j = 0; _j < this.DvecLength; ++_j) {_o.Dvec.Add(this.Dvec(_j));} |
| 126 | _o.Fvec = new List<float>(); |
| 127 | for (var _j = 0; _j < this.FvecLength; ++_j) {_o.Fvec.Add(this.Fvec(_j));} |
| 128 | } |
| 129 | public static Offset<MyGame.MonsterExtra> Pack(FlatBufferBuilder builder, MonsterExtraT _o) { |
| 130 | if (_o == null) return default(Offset<MyGame.MonsterExtra>); |
| 131 | var _dvec = default(VectorOffset); |
| 132 | if (_o.Dvec != null) { |
| 133 | var __dvec = _o.Dvec.ToArray(); |
| 134 | _dvec = CreateDvecVector(builder, __dvec); |
| 135 | } |
| 136 | var _fvec = default(VectorOffset); |
| 137 | if (_o.Fvec != null) { |
| 138 | var __fvec = _o.Fvec.ToArray(); |
| 139 | _fvec = CreateFvecVector(builder, __fvec); |
| 140 | } |
| 141 | return CreateMonsterExtra( |
| 142 | builder, |
| 143 | _o.D0, |
| 144 | _o.D1, |
| 145 | _o.D2, |
| 146 | _o.D3, |
| 147 | _o.F0, |
| 148 | _o.F1, |
| 149 | _o.F2, |
| 150 | _o.F3, |
| 151 | _dvec, |
| 152 | _fvec); |
| 153 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 154 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 155 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 156 | public class MonsterExtraT |
| 157 | { |
| 158 | [Newtonsoft.Json.JsonProperty("d0")] |
| 159 | public double D0 { get; set; } |
| 160 | [Newtonsoft.Json.JsonProperty("d1")] |
| 161 | public double D1 { get; set; } |
| 162 | [Newtonsoft.Json.JsonProperty("d2")] |
| 163 | public double D2 { get; set; } |
| 164 | [Newtonsoft.Json.JsonProperty("d3")] |
| 165 | public double D3 { get; set; } |
| 166 | [Newtonsoft.Json.JsonProperty("f0")] |
| 167 | public float F0 { get; set; } |
| 168 | [Newtonsoft.Json.JsonProperty("f1")] |
| 169 | public float F1 { get; set; } |
| 170 | [Newtonsoft.Json.JsonProperty("f2")] |
| 171 | public float F2 { get; set; } |
| 172 | [Newtonsoft.Json.JsonProperty("f3")] |
| 173 | public float F3 { get; set; } |
| 174 | [Newtonsoft.Json.JsonProperty("dvec")] |
| 175 | public List<double> Dvec { get; set; } |
| 176 | [Newtonsoft.Json.JsonProperty("fvec")] |
| 177 | public List<float> Fvec { get; set; } |
| 178 | |
| 179 | public MonsterExtraT() { |
| 180 | this.D0 = Double.NaN; |
| 181 | this.D1 = Double.NaN; |
| 182 | this.D2 = Double.PositiveInfinity; |
| 183 | this.D3 = Double.NegativeInfinity; |
| 184 | this.F0 = Single.NaN; |
| 185 | this.F1 = Single.NaN; |
| 186 | this.F2 = Single.PositiveInfinity; |
| 187 | this.F3 = Single.NegativeInfinity; |
| 188 | this.Dvec = null; |
| 189 | this.Fvec = null; |
| 190 | } |
| 191 | |
| 192 | public static MonsterExtraT DeserializeFromJson(string jsonText) { |
| 193 | return Newtonsoft.Json.JsonConvert.DeserializeObject<MonsterExtraT>(jsonText); |
| 194 | } |
| 195 | public string SerializeToJson() { |
| 196 | return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); |
| 197 | } |
| 198 | public static MonsterExtraT DeserializeFromBinary(byte[] fbBuffer) { |
| 199 | return MonsterExtra.GetRootAsMonsterExtra(new ByteBuffer(fbBuffer)).UnPack(); |
| 200 | } |
| 201 | public byte[] SerializeToBinary() { |
| 202 | var fbb = new FlatBufferBuilder(0x10000); |
| 203 | MonsterExtra.FinishMonsterExtraBuffer(fbb, MonsterExtra.Pack(fbb, this)); |
| 204 | return fbb.DataBuffer.ToSizedArray(); |
| 205 | } |
| 206 | } |
| 207 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 208 | |
| 209 | } |