...

Text file src/github.com/google/flatbuffers/tests/MyGame/Example/Vec3.cs

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     1// <auto-generated>
     2//  automatically generated by the FlatBuffers compiler, do not modify
     3// </auto-generated>
     4
     5namespace MyGame.Example
     6{
     7
     8using global::System;
     9using global::System.Collections.Generic;
    10using global::Google.FlatBuffers;
    11
    12public struct Vec3 : 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 Vec3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
    18
    19  public float X { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }
    20  public void MutateX(float x) { __p.bb.PutFloat(__p.bb_pos + 0, x); }
    21  public float Y { get { return __p.bb.GetFloat(__p.bb_pos + 4); } }
    22  public void MutateY(float y) { __p.bb.PutFloat(__p.bb_pos + 4, y); }
    23  public float Z { get { return __p.bb.GetFloat(__p.bb_pos + 8); } }
    24  public void MutateZ(float z) { __p.bb.PutFloat(__p.bb_pos + 8, z); }
    25  public double Test1 { get { return __p.bb.GetDouble(__p.bb_pos + 16); } }
    26  public void MutateTest1(double test1) { __p.bb.PutDouble(__p.bb_pos + 16, test1); }
    27  public MyGame.Example.Color Test2 { get { return (MyGame.Example.Color)__p.bb.Get(__p.bb_pos + 24); } }
    28  public void MutateTest2(MyGame.Example.Color test2) { __p.bb.Put(__p.bb_pos + 24, (byte)test2); }
    29  public MyGame.Example.Test Test3 { get { return (new MyGame.Example.Test()).__assign(__p.bb_pos + 26, __p.bb); } }
    30
    31  public static Offset<MyGame.Example.Vec3> CreateVec3(FlatBufferBuilder builder, float X, float Y, float Z, double Test1, MyGame.Example.Color Test2, short test3_A, sbyte test3_B) {
    32    builder.Prep(8, 32);
    33    builder.Pad(2);
    34    builder.Prep(2, 4);
    35    builder.Pad(1);
    36    builder.PutSbyte(test3_B);
    37    builder.PutShort(test3_A);
    38    builder.Pad(1);
    39    builder.PutByte((byte)Test2);
    40    builder.PutDouble(Test1);
    41    builder.Pad(4);
    42    builder.PutFloat(Z);
    43    builder.PutFloat(Y);
    44    builder.PutFloat(X);
    45    return new Offset<MyGame.Example.Vec3>(builder.Offset);
    46  }
    47  public Vec3T UnPack() {
    48    var _o = new Vec3T();
    49    this.UnPackTo(_o);
    50    return _o;
    51  }
    52  public void UnPackTo(Vec3T _o) {
    53    _o.X = this.X;
    54    _o.Y = this.Y;
    55    _o.Z = this.Z;
    56    _o.Test1 = this.Test1;
    57    _o.Test2 = this.Test2;
    58    _o.Test3 = this.Test3.UnPack();
    59  }
    60  public static Offset<MyGame.Example.Vec3> Pack(FlatBufferBuilder builder, Vec3T _o) {
    61    if (_o == null) return default(Offset<MyGame.Example.Vec3>);
    62    var _test3_a = _o.Test3.A;
    63    var _test3_b = _o.Test3.B;
    64    return CreateVec3(
    65      builder,
    66      _o.X,
    67      _o.Y,
    68      _o.Z,
    69      _o.Test1,
    70      _o.Test2,
    71      _test3_a,
    72      _test3_b);
    73  }
    74}
    75
    76public class Vec3T
    77{
    78  [Newtonsoft.Json.JsonProperty("x")]
    79  public float X { get; set; }
    80  [Newtonsoft.Json.JsonProperty("y")]
    81  public float Y { get; set; }
    82  [Newtonsoft.Json.JsonProperty("z")]
    83  public float Z { get; set; }
    84  [Newtonsoft.Json.JsonProperty("test1")]
    85  public double Test1 { get; set; }
    86  [Newtonsoft.Json.JsonProperty("test2")]
    87  public MyGame.Example.Color Test2 { get; set; }
    88  [Newtonsoft.Json.JsonProperty("test3")]
    89  public MyGame.Example.TestT Test3 { get; set; }
    90
    91  public Vec3T() {
    92    this.X = 0.0f;
    93    this.Y = 0.0f;
    94    this.Z = 0.0f;
    95    this.Test1 = 0.0;
    96    this.Test2 = 0;
    97    this.Test3 = new MyGame.Example.TestT();
    98  }
    99}
   100
   101
   102}

View as plain text