1 // <auto-generated> 2 // automatically generated by the FlatBuffers compiler, do not modify 3 // </auto-generated> 4 5 namespace optional_scalars 6 { 7 8 using global::System; 9 using global::System.Collections.Generic; 10 using global::FlatBuffers; 11 12 public struct ScalarStuff : IFlatbufferObject 13 { 14 private Table __p; 15 public ByteBuffer ByteBuffer { get { return __p.bb; } } ValidateVersionoptional_scalars.ScalarStuff16 public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_2_0_0(); } GetRootAsScalarStuffoptional_scalars.ScalarStuff17 public static ScalarStuff GetRootAsScalarStuff(ByteBuffer _bb) { return GetRootAsScalarStuff(_bb, new ScalarStuff()); } GetRootAsScalarStuffoptional_scalars.ScalarStuff18 public static ScalarStuff GetRootAsScalarStuff(ByteBuffer _bb, ScalarStuff obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } ScalarStuffBufferHasIdentifieroptional_scalars.ScalarStuff19 public static bool ScalarStuffBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "NULL"); } __initoptional_scalars.ScalarStuff20 public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } __assignoptional_scalars.ScalarStuff21 public ScalarStuff __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 22 23 public sbyte JustI8 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } } 24 public sbyte? MaybeI8 { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte?)null; } } 25 public sbyte DefaultI8 { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)42; } } 26 public byte JustU8 { get { int o = __p.__offset(10); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte)0; } } 27 public byte? MaybeU8 { get { int o = __p.__offset(12); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte?)null; } } 28 public byte DefaultU8 { get { int o = __p.__offset(14); return o != 0 ? __p.bb.Get(o + __p.bb_pos) : (byte)42; } } 29 public short JustI16 { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } } 30 public short? MaybeI16 { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short?)null; } } 31 public short DefaultI16 { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)42; } } 32 public ushort JustU16 { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } } 33 public ushort? MaybeU16 { get { int o = __p.__offset(24); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort?)null; } } 34 public ushort DefaultU16 { get { int o = __p.__offset(26); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)42; } } 35 public int JustI32 { get { int o = __p.__offset(28); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } 36 public int? MaybeI32 { get { int o = __p.__offset(30); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int?)null; } } 37 public int DefaultI32 { get { int o = __p.__offset(32); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)42; } } 38 public uint JustU32 { get { int o = __p.__offset(34); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } 39 public uint? MaybeU32 { get { int o = __p.__offset(36); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint?)null; } } 40 public uint DefaultU32 { get { int o = __p.__offset(38); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)42; } } 41 public long JustI64 { get { int o = __p.__offset(40); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } 42 public long? MaybeI64 { get { int o = __p.__offset(42); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long?)null; } } 43 public long DefaultI64 { get { int o = __p.__offset(44); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)42; } } 44 public ulong JustU64 { get { int o = __p.__offset(46); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)0; } } 45 public ulong? MaybeU64 { get { int o = __p.__offset(48); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong?)null; } } 46 public ulong DefaultU64 { get { int o = __p.__offset(50); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)42; } } 47 public float JustF32 { get { int o = __p.__offset(52); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } } 48 public float? MaybeF32 { get { int o = __p.__offset(54); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float?)null; } } 49 public float DefaultF32 { get { int o = __p.__offset(56); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)42.0f; } } 50 public double JustF64 { get { int o = __p.__offset(58); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)0.0; } } 51 public double? MaybeF64 { get { int o = __p.__offset(60); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double?)null; } } 52 public double DefaultF64 { get { int o = __p.__offset(62); return o != 0 ? __p.bb.GetDouble(o + __p.bb_pos) : (double)42.0; } } 53 public bool JustBool { get { int o = __p.__offset(64); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } } 54 public bool? MaybeBool { get { int o = __p.__offset(66); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool?)null; } } 55 public bool DefaultBool { get { int o = __p.__offset(68); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)true; } } 56 public optional_scalars.OptionalByte JustEnum { get { int o = __p.__offset(70); return o != 0 ? (optional_scalars.OptionalByte)__p.bb.GetSbyte(o + __p.bb_pos) : optional_scalars.OptionalByte.None; } } 57 public optional_scalars.OptionalByte? MaybeEnum { get { int o = __p.__offset(72); return o != 0 ? (optional_scalars.OptionalByte)__p.bb.GetSbyte(o + __p.bb_pos) : (optional_scalars.OptionalByte?)null; } } 58 public optional_scalars.OptionalByte DefaultEnum { get { int o = __p.__offset(74); return o != 0 ? (optional_scalars.OptionalByte)__p.bb.GetSbyte(o + __p.bb_pos) : optional_scalars.OptionalByte.One; } } 59 CreateScalarStuffoptional_scalars.ScalarStuff60 public static Offset<optional_scalars.ScalarStuff> CreateScalarStuff(FlatBufferBuilder builder, 61 sbyte just_i8 = 0, 62 sbyte? maybe_i8 = null, 63 sbyte default_i8 = 42, 64 byte just_u8 = 0, 65 byte? maybe_u8 = null, 66 byte default_u8 = 42, 67 short just_i16 = 0, 68 short? maybe_i16 = null, 69 short default_i16 = 42, 70 ushort just_u16 = 0, 71 ushort? maybe_u16 = null, 72 ushort default_u16 = 42, 73 int just_i32 = 0, 74 int? maybe_i32 = null, 75 int default_i32 = 42, 76 uint just_u32 = 0, 77 uint? maybe_u32 = null, 78 uint default_u32 = 42, 79 long just_i64 = 0, 80 long? maybe_i64 = null, 81 long default_i64 = 42, 82 ulong just_u64 = 0, 83 ulong? maybe_u64 = null, 84 ulong default_u64 = 42, 85 float just_f32 = 0.0f, 86 float? maybe_f32 = null, 87 float default_f32 = 42.0f, 88 double just_f64 = 0.0, 89 double? maybe_f64 = null, 90 double default_f64 = 42.0, 91 bool just_bool = false, 92 bool? maybe_bool = null, 93 bool default_bool = true, 94 optional_scalars.OptionalByte just_enum = optional_scalars.OptionalByte.None, 95 optional_scalars.OptionalByte? maybe_enum = null, 96 optional_scalars.OptionalByte default_enum = optional_scalars.OptionalByte.One) { 97 builder.StartTable(36); 98 ScalarStuff.AddDefaultF64(builder, default_f64); 99 ScalarStuff.AddMaybeF64(builder, maybe_f64); 100 ScalarStuff.AddJustF64(builder, just_f64); 101 ScalarStuff.AddDefaultU64(builder, default_u64); 102 ScalarStuff.AddMaybeU64(builder, maybe_u64); 103 ScalarStuff.AddJustU64(builder, just_u64); 104 ScalarStuff.AddDefaultI64(builder, default_i64); 105 ScalarStuff.AddMaybeI64(builder, maybe_i64); 106 ScalarStuff.AddJustI64(builder, just_i64); 107 ScalarStuff.AddDefaultF32(builder, default_f32); 108 ScalarStuff.AddMaybeF32(builder, maybe_f32); 109 ScalarStuff.AddJustF32(builder, just_f32); 110 ScalarStuff.AddDefaultU32(builder, default_u32); 111 ScalarStuff.AddMaybeU32(builder, maybe_u32); 112 ScalarStuff.AddJustU32(builder, just_u32); 113 ScalarStuff.AddDefaultI32(builder, default_i32); 114 ScalarStuff.AddMaybeI32(builder, maybe_i32); 115 ScalarStuff.AddJustI32(builder, just_i32); 116 ScalarStuff.AddDefaultU16(builder, default_u16); 117 ScalarStuff.AddMaybeU16(builder, maybe_u16); 118 ScalarStuff.AddJustU16(builder, just_u16); 119 ScalarStuff.AddDefaultI16(builder, default_i16); 120 ScalarStuff.AddMaybeI16(builder, maybe_i16); 121 ScalarStuff.AddJustI16(builder, just_i16); 122 ScalarStuff.AddDefaultEnum(builder, default_enum); 123 ScalarStuff.AddMaybeEnum(builder, maybe_enum); 124 ScalarStuff.AddJustEnum(builder, just_enum); 125 ScalarStuff.AddDefaultBool(builder, default_bool); 126 ScalarStuff.AddMaybeBool(builder, maybe_bool); 127 ScalarStuff.AddJustBool(builder, just_bool); 128 ScalarStuff.AddDefaultU8(builder, default_u8); 129 ScalarStuff.AddMaybeU8(builder, maybe_u8); 130 ScalarStuff.AddJustU8(builder, just_u8); 131 ScalarStuff.AddDefaultI8(builder, default_i8); 132 ScalarStuff.AddMaybeI8(builder, maybe_i8); 133 ScalarStuff.AddJustI8(builder, just_i8); 134 return ScalarStuff.EndScalarStuff(builder); 135 } 136 StartScalarStuffoptional_scalars.ScalarStuff137 public static void StartScalarStuff(FlatBufferBuilder builder) { builder.StartTable(36); } AddJustI8optional_scalars.ScalarStuff138 public static void AddJustI8(FlatBufferBuilder builder, sbyte justI8) { builder.AddSbyte(0, justI8, 0); } AddMaybeI8optional_scalars.ScalarStuff139 public static void AddMaybeI8(FlatBufferBuilder builder, sbyte? maybeI8) { builder.AddSbyte(1, maybeI8); } AddDefaultI8optional_scalars.ScalarStuff140 public static void AddDefaultI8(FlatBufferBuilder builder, sbyte defaultI8) { builder.AddSbyte(2, defaultI8, 42); } AddJustU8optional_scalars.ScalarStuff141 public static void AddJustU8(FlatBufferBuilder builder, byte justU8) { builder.AddByte(3, justU8, 0); } AddMaybeU8optional_scalars.ScalarStuff142 public static void AddMaybeU8(FlatBufferBuilder builder, byte? maybeU8) { builder.AddByte(4, maybeU8); } AddDefaultU8optional_scalars.ScalarStuff143 public static void AddDefaultU8(FlatBufferBuilder builder, byte defaultU8) { builder.AddByte(5, defaultU8, 42); } AddJustI16optional_scalars.ScalarStuff144 public static void AddJustI16(FlatBufferBuilder builder, short justI16) { builder.AddShort(6, justI16, 0); } AddMaybeI16optional_scalars.ScalarStuff145 public static void AddMaybeI16(FlatBufferBuilder builder, short? maybeI16) { builder.AddShort(7, maybeI16); } AddDefaultI16optional_scalars.ScalarStuff146 public static void AddDefaultI16(FlatBufferBuilder builder, short defaultI16) { builder.AddShort(8, defaultI16, 42); } AddJustU16optional_scalars.ScalarStuff147 public static void AddJustU16(FlatBufferBuilder builder, ushort justU16) { builder.AddUshort(9, justU16, 0); } AddMaybeU16optional_scalars.ScalarStuff148 public static void AddMaybeU16(FlatBufferBuilder builder, ushort? maybeU16) { builder.AddUshort(10, maybeU16); } AddDefaultU16optional_scalars.ScalarStuff149 public static void AddDefaultU16(FlatBufferBuilder builder, ushort defaultU16) { builder.AddUshort(11, defaultU16, 42); } AddJustI32optional_scalars.ScalarStuff150 public static void AddJustI32(FlatBufferBuilder builder, int justI32) { builder.AddInt(12, justI32, 0); } AddMaybeI32optional_scalars.ScalarStuff151 public static void AddMaybeI32(FlatBufferBuilder builder, int? maybeI32) { builder.AddInt(13, maybeI32); } AddDefaultI32optional_scalars.ScalarStuff152 public static void AddDefaultI32(FlatBufferBuilder builder, int defaultI32) { builder.AddInt(14, defaultI32, 42); } AddJustU32optional_scalars.ScalarStuff153 public static void AddJustU32(FlatBufferBuilder builder, uint justU32) { builder.AddUint(15, justU32, 0); } AddMaybeU32optional_scalars.ScalarStuff154 public static void AddMaybeU32(FlatBufferBuilder builder, uint? maybeU32) { builder.AddUint(16, maybeU32); } AddDefaultU32optional_scalars.ScalarStuff155 public static void AddDefaultU32(FlatBufferBuilder builder, uint defaultU32) { builder.AddUint(17, defaultU32, 42); } AddJustI64optional_scalars.ScalarStuff156 public static void AddJustI64(FlatBufferBuilder builder, long justI64) { builder.AddLong(18, justI64, 0); } AddMaybeI64optional_scalars.ScalarStuff157 public static void AddMaybeI64(FlatBufferBuilder builder, long? maybeI64) { builder.AddLong(19, maybeI64); } AddDefaultI64optional_scalars.ScalarStuff158 public static void AddDefaultI64(FlatBufferBuilder builder, long defaultI64) { builder.AddLong(20, defaultI64, 42); } AddJustU64optional_scalars.ScalarStuff159 public static void AddJustU64(FlatBufferBuilder builder, ulong justU64) { builder.AddUlong(21, justU64, 0); } AddMaybeU64optional_scalars.ScalarStuff160 public static void AddMaybeU64(FlatBufferBuilder builder, ulong? maybeU64) { builder.AddUlong(22, maybeU64); } AddDefaultU64optional_scalars.ScalarStuff161 public static void AddDefaultU64(FlatBufferBuilder builder, ulong defaultU64) { builder.AddUlong(23, defaultU64, 42); } AddJustF32optional_scalars.ScalarStuff162 public static void AddJustF32(FlatBufferBuilder builder, float justF32) { builder.AddFloat(24, justF32, 0.0f); } AddMaybeF32optional_scalars.ScalarStuff163 public static void AddMaybeF32(FlatBufferBuilder builder, float? maybeF32) { builder.AddFloat(25, maybeF32); } AddDefaultF32optional_scalars.ScalarStuff164 public static void AddDefaultF32(FlatBufferBuilder builder, float defaultF32) { builder.AddFloat(26, defaultF32, 42.0f); } AddJustF64optional_scalars.ScalarStuff165 public static void AddJustF64(FlatBufferBuilder builder, double justF64) { builder.AddDouble(27, justF64, 0.0); } AddMaybeF64optional_scalars.ScalarStuff166 public static void AddMaybeF64(FlatBufferBuilder builder, double? maybeF64) { builder.AddDouble(28, maybeF64); } AddDefaultF64optional_scalars.ScalarStuff167 public static void AddDefaultF64(FlatBufferBuilder builder, double defaultF64) { builder.AddDouble(29, defaultF64, 42.0); } AddJustBooloptional_scalars.ScalarStuff168 public static void AddJustBool(FlatBufferBuilder builder, bool justBool) { builder.AddBool(30, justBool, false); } AddMaybeBooloptional_scalars.ScalarStuff169 public static void AddMaybeBool(FlatBufferBuilder builder, bool? maybeBool) { builder.AddBool(31, maybeBool); } AddDefaultBooloptional_scalars.ScalarStuff170 public static void AddDefaultBool(FlatBufferBuilder builder, bool defaultBool) { builder.AddBool(32, defaultBool, true); } AddJustEnumoptional_scalars.ScalarStuff171 public static void AddJustEnum(FlatBufferBuilder builder, optional_scalars.OptionalByte justEnum) { builder.AddSbyte(33, (sbyte)justEnum, 0); } AddMaybeEnumoptional_scalars.ScalarStuff172 public static void AddMaybeEnum(FlatBufferBuilder builder, optional_scalars.OptionalByte? maybeEnum) { builder.AddSbyte(34, (sbyte)maybeEnum); } AddDefaultEnumoptional_scalars.ScalarStuff173 public static void AddDefaultEnum(FlatBufferBuilder builder, optional_scalars.OptionalByte defaultEnum) { builder.AddSbyte(35, (sbyte)defaultEnum, 1); } EndScalarStuffoptional_scalars.ScalarStuff174 public static Offset<optional_scalars.ScalarStuff> EndScalarStuff(FlatBufferBuilder builder) { 175 int o = builder.EndTable(); 176 return new Offset<optional_scalars.ScalarStuff>(o); 177 } FinishScalarStuffBufferoptional_scalars.ScalarStuff178 public static void FinishScalarStuffBuffer(FlatBufferBuilder builder, Offset<optional_scalars.ScalarStuff> offset) { builder.Finish(offset.Value, "NULL"); } FinishSizePrefixedScalarStuffBufferoptional_scalars.ScalarStuff179 public static void FinishSizePrefixedScalarStuffBuffer(FlatBufferBuilder builder, Offset<optional_scalars.ScalarStuff> offset) { builder.FinishSizePrefixed(offset.Value, "NULL"); } UnPackoptional_scalars.ScalarStuff180 public ScalarStuffT UnPack() { 181 var _o = new ScalarStuffT(); 182 this.UnPackTo(_o); 183 return _o; 184 } UnPackTooptional_scalars.ScalarStuff185 public void UnPackTo(ScalarStuffT _o) { 186 _o.JustI8 = this.JustI8; 187 _o.MaybeI8 = this.MaybeI8; 188 _o.DefaultI8 = this.DefaultI8; 189 _o.JustU8 = this.JustU8; 190 _o.MaybeU8 = this.MaybeU8; 191 _o.DefaultU8 = this.DefaultU8; 192 _o.JustI16 = this.JustI16; 193 _o.MaybeI16 = this.MaybeI16; 194 _o.DefaultI16 = this.DefaultI16; 195 _o.JustU16 = this.JustU16; 196 _o.MaybeU16 = this.MaybeU16; 197 _o.DefaultU16 = this.DefaultU16; 198 _o.JustI32 = this.JustI32; 199 _o.MaybeI32 = this.MaybeI32; 200 _o.DefaultI32 = this.DefaultI32; 201 _o.JustU32 = this.JustU32; 202 _o.MaybeU32 = this.MaybeU32; 203 _o.DefaultU32 = this.DefaultU32; 204 _o.JustI64 = this.JustI64; 205 _o.MaybeI64 = this.MaybeI64; 206 _o.DefaultI64 = this.DefaultI64; 207 _o.JustU64 = this.JustU64; 208 _o.MaybeU64 = this.MaybeU64; 209 _o.DefaultU64 = this.DefaultU64; 210 _o.JustF32 = this.JustF32; 211 _o.MaybeF32 = this.MaybeF32; 212 _o.DefaultF32 = this.DefaultF32; 213 _o.JustF64 = this.JustF64; 214 _o.MaybeF64 = this.MaybeF64; 215 _o.DefaultF64 = this.DefaultF64; 216 _o.JustBool = this.JustBool; 217 _o.MaybeBool = this.MaybeBool; 218 _o.DefaultBool = this.DefaultBool; 219 _o.JustEnum = this.JustEnum; 220 _o.MaybeEnum = this.MaybeEnum; 221 _o.DefaultEnum = this.DefaultEnum; 222 } Packoptional_scalars.ScalarStuff223 public static Offset<optional_scalars.ScalarStuff> Pack(FlatBufferBuilder builder, ScalarStuffT _o) { 224 if (_o == null) return default(Offset<optional_scalars.ScalarStuff>); 225 return CreateScalarStuff( 226 builder, 227 _o.JustI8, 228 _o.MaybeI8, 229 _o.DefaultI8, 230 _o.JustU8, 231 _o.MaybeU8, 232 _o.DefaultU8, 233 _o.JustI16, 234 _o.MaybeI16, 235 _o.DefaultI16, 236 _o.JustU16, 237 _o.MaybeU16, 238 _o.DefaultU16, 239 _o.JustI32, 240 _o.MaybeI32, 241 _o.DefaultI32, 242 _o.JustU32, 243 _o.MaybeU32, 244 _o.DefaultU32, 245 _o.JustI64, 246 _o.MaybeI64, 247 _o.DefaultI64, 248 _o.JustU64, 249 _o.MaybeU64, 250 _o.DefaultU64, 251 _o.JustF32, 252 _o.MaybeF32, 253 _o.DefaultF32, 254 _o.JustF64, 255 _o.MaybeF64, 256 _o.DefaultF64, 257 _o.JustBool, 258 _o.MaybeBool, 259 _o.DefaultBool, 260 _o.JustEnum, 261 _o.MaybeEnum, 262 _o.DefaultEnum); 263 } 264 }; 265 266 public class ScalarStuffT 267 { 268 public sbyte JustI8 { get; set; } 269 public sbyte? MaybeI8 { get; set; } 270 public sbyte DefaultI8 { get; set; } 271 public byte JustU8 { get; set; } 272 public byte? MaybeU8 { get; set; } 273 public byte DefaultU8 { get; set; } 274 public short JustI16 { get; set; } 275 public short? MaybeI16 { get; set; } 276 public short DefaultI16 { get; set; } 277 public ushort JustU16 { get; set; } 278 public ushort? MaybeU16 { get; set; } 279 public ushort DefaultU16 { get; set; } 280 public int JustI32 { get; set; } 281 public int? MaybeI32 { get; set; } 282 public int DefaultI32 { get; set; } 283 public uint JustU32 { get; set; } 284 public uint? MaybeU32 { get; set; } 285 public uint DefaultU32 { get; set; } 286 public long JustI64 { get; set; } 287 public long? MaybeI64 { get; set; } 288 public long DefaultI64 { get; set; } 289 public ulong JustU64 { get; set; } 290 public ulong? MaybeU64 { get; set; } 291 public ulong DefaultU64 { get; set; } 292 public float JustF32 { get; set; } 293 public float? MaybeF32 { get; set; } 294 public float DefaultF32 { get; set; } 295 public double JustF64 { get; set; } 296 public double? MaybeF64 { get; set; } 297 public double DefaultF64 { get; set; } 298 public bool JustBool { get; set; } 299 public bool? MaybeBool { get; set; } 300 public bool DefaultBool { get; set; } 301 public optional_scalars.OptionalByte JustEnum { get; set; } 302 public optional_scalars.OptionalByte? MaybeEnum { get; set; } 303 public optional_scalars.OptionalByte DefaultEnum { get; set; } 304 ScalarStuffT()305 public ScalarStuffT() { 306 this.JustI8 = 0; 307 this.MaybeI8 = null; 308 this.DefaultI8 = 42; 309 this.JustU8 = 0; 310 this.MaybeU8 = null; 311 this.DefaultU8 = 42; 312 this.JustI16 = 0; 313 this.MaybeI16 = null; 314 this.DefaultI16 = 42; 315 this.JustU16 = 0; 316 this.MaybeU16 = null; 317 this.DefaultU16 = 42; 318 this.JustI32 = 0; 319 this.MaybeI32 = null; 320 this.DefaultI32 = 42; 321 this.JustU32 = 0; 322 this.MaybeU32 = null; 323 this.DefaultU32 = 42; 324 this.JustI64 = 0; 325 this.MaybeI64 = null; 326 this.DefaultI64 = 42; 327 this.JustU64 = 0; 328 this.MaybeU64 = null; 329 this.DefaultU64 = 42; 330 this.JustF32 = 0.0f; 331 this.MaybeF32 = null; 332 this.DefaultF32 = 42.0f; 333 this.JustF64 = 0.0; 334 this.MaybeF64 = null; 335 this.DefaultF64 = 42.0; 336 this.JustBool = false; 337 this.MaybeBool = null; 338 this.DefaultBool = true; 339 this.JustEnum = optional_scalars.OptionalByte.None; 340 this.MaybeEnum = null; 341 this.DefaultEnum = optional_scalars.OptionalByte.One; 342 } DeserializeFromBinary(byte[] fbBuffer)343 public static ScalarStuffT DeserializeFromBinary(byte[] fbBuffer) { 344 return ScalarStuff.GetRootAsScalarStuff(new ByteBuffer(fbBuffer)).UnPack(); 345 } SerializeToBinary()346 public byte[] SerializeToBinary() { 347 var fbb = new FlatBufferBuilder(0x10000); 348 ScalarStuff.FinishScalarStuffBuffer(fbb, ScalarStuff.Pack(fbb, this)); 349 return fbb.DataBuffer.ToSizedArray(); 350 } 351 } 352 353 354 } 355