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.Example |
| 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 | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 10 | using global::FlatBuffers; |
| 11 | |
| 12 | public struct Test : IFlatbufferObject |
| 13 | { |
| 14 | private Struct __p; |
| 15 | public ByteBuffer ByteBuffer { get { return __p.bb; } } |
| 16 | public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); } |
| 17 | public Test __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 18 | |
| 19 | public short A { get { return __p.bb.GetShort(__p.bb_pos + 0); } } |
| 20 | public void MutateA(short a) { __p.bb.PutShort(__p.bb_pos + 0, a); } |
| 21 | public sbyte B { get { return __p.bb.GetSbyte(__p.bb_pos + 2); } } |
| 22 | public void MutateB(sbyte b) { __p.bb.PutSbyte(__p.bb_pos + 2, b); } |
| 23 | |
| 24 | public static Offset<MyGame.Example.Test> CreateTest(FlatBufferBuilder builder, short A, sbyte B) { |
| 25 | builder.Prep(2, 4); |
| 26 | builder.Pad(1); |
| 27 | builder.PutSbyte(B); |
| 28 | builder.PutShort(A); |
| 29 | return new Offset<MyGame.Example.Test>(builder.Offset); |
| 30 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 31 | public TestT UnPack() { |
| 32 | var _o = new TestT(); |
| 33 | this.UnPackTo(_o); |
| 34 | return _o; |
| 35 | } |
| 36 | public void UnPackTo(TestT _o) { |
| 37 | _o.A = this.A; |
| 38 | _o.B = this.B; |
| 39 | } |
| 40 | public static Offset<MyGame.Example.Test> Pack(FlatBufferBuilder builder, TestT _o) { |
| 41 | if (_o == null) return default(Offset<MyGame.Example.Test>); |
| 42 | return CreateTest( |
| 43 | builder, |
| 44 | _o.A, |
| 45 | _o.B); |
| 46 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 49 | public class TestT |
| 50 | { |
| 51 | [Newtonsoft.Json.JsonProperty("a")] |
| 52 | public short A { get; set; } |
| 53 | [Newtonsoft.Json.JsonProperty("b")] |
| 54 | public sbyte B { get; set; } |
| 55 | |
| 56 | public TestT() { |
| 57 | this.A = 0; |
| 58 | this.B = 0; |
| 59 | } |
| 60 | } |
| 61 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 62 | |
| 63 | } |