"Fossies" - the Fresh Open Source Software Archive 
Member "flatbuffers-23.1.21/tests/MyGame/Example/Ability.cs" (21 Jan 2023, 1779 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
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;
9 using global::System.Collections.Generic;
10 using global::Google.FlatBuffers;
11
12 public 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
48 public 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 }