xref: /aosp_15_r20/external/flatbuffers/tests/union_vector/FallingTub.cs (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // <auto-generated>
2 //  automatically generated by the FlatBuffers compiler, do not modify
3 // </auto-generated>
4 
5 using global::System;
6 using global::System.Collections.Generic;
7 using global::FlatBuffers;
8 
9 public struct FallingTub : IFlatbufferObject
10 {
11   private Struct __p;
12   public ByteBuffer ByteBuffer { get { return __p.bb; } }
__initFallingTub13   public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
__assignFallingTub14   public FallingTub __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
15 
16   public int Weight { get { return __p.bb.GetInt(__p.bb_pos + 0); } }
MutateWeightFallingTub17   public void MutateWeight(int weight) { __p.bb.PutInt(__p.bb_pos + 0, weight); }
18 
CreateFallingTubFallingTub19   public static Offset<FallingTub> CreateFallingTub(FlatBufferBuilder builder, int Weight) {
20     builder.Prep(4, 4);
21     builder.PutInt(Weight);
22     return new Offset<FallingTub>(builder.Offset);
23   }
UnPackFallingTub24   public FallingTubT UnPack() {
25     var _o = new FallingTubT();
26     this.UnPackTo(_o);
27     return _o;
28   }
UnPackToFallingTub29   public void UnPackTo(FallingTubT _o) {
30     _o.Weight = this.Weight;
31   }
PackFallingTub32   public static Offset<FallingTub> Pack(FlatBufferBuilder builder, FallingTubT _o) {
33     if (_o == null) return default(Offset<FallingTub>);
34     return CreateFallingTub(
35       builder,
36       _o.Weight);
37   }
38 }
39 
40 public class FallingTubT
41 {
42   [Newtonsoft.Json.JsonProperty("weight")]
43   public int Weight { get; set; }
44 
FallingTubT()45   public FallingTubT() {
46     this.Weight = 0;
47   }
48 }
49 
50