...

Text file src/github.com/google/flatbuffers/tests/MyGame/Example/Ability.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 Ability : 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 Ability __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
    18
    19  public uint Id { get { return __p.bb.GetUint(__p.bb_pos + 0); } }
    20  public void MutateId(uint id) { __p.bb.PutUint(__p.bb_pos + 0, id); }
    21  public uint Distance { get { return __p.bb.GetUint(__p.bb_pos + 4); } }
    22  public void MutateDistance(uint distance) { __p.bb.PutUint(__p.bb_pos + 4, distance); }
    23
    24  public static Offset<MyGame.Example.Ability> CreateAbility(FlatBufferBuilder builder, uint Id, uint Distance) {
    25    builder.Prep(4, 8);
    26    builder.PutUint(Distance);
    27    builder.PutUint(Id);
    28    return new Offset<MyGame.Example.Ability>(builder.Offset);
    29  }
    30  public AbilityT UnPack() {
    31    var _o = new AbilityT();
    32    this.UnPackTo(_o);
    33    return _o;
    34  }
    35  public void UnPackTo(AbilityT _o) {
    36    _o.Id = this.Id;
    37    _o.Distance = this.Distance;
    38  }
    39  public static Offset<MyGame.Example.Ability> Pack(FlatBufferBuilder builder, AbilityT _o) {
    40    if (_o == null) return default(Offset<MyGame.Example.Ability>);
    41    return CreateAbility(
    42      builder,
    43      _o.Id,
    44      _o.Distance);
    45  }
    46}
    47
    48public class AbilityT
    49{
    50  [Newtonsoft.Json.JsonProperty("id")]
    51  public uint Id { get; set; }
    52  [Newtonsoft.Json.JsonProperty("distance")]
    53  public uint Distance { get; set; }
    54
    55  public AbilityT() {
    56    this.Id = 0;
    57    this.Distance = 0;
    58  }
    59}
    60
    61
    62}

View as plain text