• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2// ignore_for_file: unused_import, unused_field, unused_local_variable
3
4library my_game;
5
6import 'dart:typed_data' show Uint8List;
7import 'package:flat_buffers/flat_buffers.dart' as fb;
8
9
10class MonsterExtra {
11  MonsterExtra._(this._bc, this._bcOffset);
12  factory MonsterExtra(List<int> bytes) {
13    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
14    return reader.read(rootRef, 0);
15  }
16
17  static const fb.Reader<MonsterExtra> reader = const _MonsterExtraReader();
18
19  final fb.BufferContext _bc;
20  final int _bcOffset;
21
22  double get d0 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 4, double.nan);
23  double get d1 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 6, double.nan);
24  double get d2 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 8, double.infinity);
25  double get d3 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 10, double.negativeInfinity);
26  double get f0 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 12, double.nan);
27  double get f1 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 14, double.nan);
28  double get f2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 16, double.infinity);
29  double get f3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 18, double.negativeInfinity);
30  List<double> get dvec => const fb.ListReader<double>(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 20, null);
31  List<double> get fvec => const fb.ListReader<double>(const fb.Float32Reader()).vTableGet(_bc, _bcOffset, 22, null);
32
33  @override
34  String toString() {
35    return 'MonsterExtra{d0: $d0, d1: $d1, d2: $d2, d3: $d3, f0: $f0, f1: $f1, f2: $f2, f3: $f3, dvec: $dvec, fvec: $fvec}';
36  }
37}
38
39class _MonsterExtraReader extends fb.TableReader<MonsterExtra> {
40  const _MonsterExtraReader();
41
42  @override
43  MonsterExtra createObject(fb.BufferContext bc, int offset) =>
44    new MonsterExtra._(bc, offset);
45}
46
47class MonsterExtraBuilder {
48  MonsterExtraBuilder(this.fbBuilder) {
49    assert(fbBuilder != null);
50  }
51
52  final fb.Builder fbBuilder;
53
54  void begin() {
55    fbBuilder.startTable();
56  }
57
58  int addD0(double d0) {
59    fbBuilder.addFloat64(0, d0);
60    return fbBuilder.offset;
61  }
62  int addD1(double d1) {
63    fbBuilder.addFloat64(1, d1);
64    return fbBuilder.offset;
65  }
66  int addD2(double d2) {
67    fbBuilder.addFloat64(2, d2);
68    return fbBuilder.offset;
69  }
70  int addD3(double d3) {
71    fbBuilder.addFloat64(3, d3);
72    return fbBuilder.offset;
73  }
74  int addF0(double f0) {
75    fbBuilder.addFloat32(4, f0);
76    return fbBuilder.offset;
77  }
78  int addF1(double f1) {
79    fbBuilder.addFloat32(5, f1);
80    return fbBuilder.offset;
81  }
82  int addF2(double f2) {
83    fbBuilder.addFloat32(6, f2);
84    return fbBuilder.offset;
85  }
86  int addF3(double f3) {
87    fbBuilder.addFloat32(7, f3);
88    return fbBuilder.offset;
89  }
90  int addDvecOffset(int offset) {
91    fbBuilder.addOffset(8, offset);
92    return fbBuilder.offset;
93  }
94  int addFvecOffset(int offset) {
95    fbBuilder.addOffset(9, offset);
96    return fbBuilder.offset;
97  }
98
99  int finish() {
100    return fbBuilder.endTable();
101  }
102}
103
104class MonsterExtraObjectBuilder extends fb.ObjectBuilder {
105  final double _d0;
106  final double _d1;
107  final double _d2;
108  final double _d3;
109  final double _f0;
110  final double _f1;
111  final double _f2;
112  final double _f3;
113  final List<double> _dvec;
114  final List<double> _fvec;
115
116  MonsterExtraObjectBuilder({
117    double d0,
118    double d1,
119    double d2,
120    double d3,
121    double f0,
122    double f1,
123    double f2,
124    double f3,
125    List<double> dvec,
126    List<double> fvec,
127  })
128      : _d0 = d0,
129        _d1 = d1,
130        _d2 = d2,
131        _d3 = d3,
132        _f0 = f0,
133        _f1 = f1,
134        _f2 = f2,
135        _f3 = f3,
136        _dvec = dvec,
137        _fvec = fvec;
138
139  /// Finish building, and store into the [fbBuilder].
140  @override
141  int finish(
142    fb.Builder fbBuilder) {
143    assert(fbBuilder != null);
144    final int dvecOffset = _dvec?.isNotEmpty == true
145        ? fbBuilder.writeListFloat64(_dvec)
146        : null;
147    final int fvecOffset = _fvec?.isNotEmpty == true
148        ? fbBuilder.writeListFloat32(_fvec)
149        : null;
150
151    fbBuilder.startTable();
152    fbBuilder.addFloat64(0, _d0);
153    fbBuilder.addFloat64(1, _d1);
154    fbBuilder.addFloat64(2, _d2);
155    fbBuilder.addFloat64(3, _d3);
156    fbBuilder.addFloat32(4, _f0);
157    fbBuilder.addFloat32(5, _f1);
158    fbBuilder.addFloat32(6, _f2);
159    fbBuilder.addFloat32(7, _f3);
160    if (dvecOffset != null) {
161      fbBuilder.addOffset(8, dvecOffset);
162    }
163    if (fvecOffset != null) {
164      fbBuilder.addOffset(9, fvecOffset);
165    }
166    return fbBuilder.endTable();
167  }
168
169  /// Convenience method to serialize to byte list.
170  @override
171  Uint8List toBytes([String fileIdentifier]) {
172    fb.Builder fbBuilder = new fb.Builder();
173    int offset = finish(fbBuilder);
174    return fbBuilder.finish(offset, fileIdentifier);
175  }
176}
177