2018-06-08 17:59:46 +00:00
|
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
// ignore_for_file: unused_import, unused_field, unused_local_variable
|
|
|
|
|
|
|
|
library my_game.example2;
|
|
|
|
|
|
|
|
import 'dart:typed_data' show Uint8List;
|
|
|
|
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
|
|
|
|
2018-09-04 02:09:38 +00:00
|
|
|
import './monster_test_my_game.example_generated.dart' as my_game_example;
|
2018-09-21 16:40:04 +00:00
|
|
|
import './monster_test_my_game_generated.dart' as my_game;
|
2018-06-08 17:59:46 +00:00
|
|
|
|
|
|
|
class Monster {
|
|
|
|
Monster._(this._bc, this._bcOffset);
|
|
|
|
factory Monster(List<int> bytes) {
|
|
|
|
fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
|
|
|
|
return reader.read(rootRef, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const fb.Reader<Monster> reader = const _MonsterReader();
|
|
|
|
|
|
|
|
final fb.BufferContext _bc;
|
|
|
|
final int _bcOffset;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return 'Monster{}';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MonsterReader extends fb.TableReader<Monster> {
|
|
|
|
const _MonsterReader();
|
|
|
|
|
|
|
|
@override
|
|
|
|
Monster createObject(fb.BufferContext bc, int offset) =>
|
|
|
|
new Monster._(bc, offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
class MonsterObjectBuilder extends fb.ObjectBuilder {
|
|
|
|
|
|
|
|
MonsterObjectBuilder();
|
|
|
|
|
|
|
|
/// Finish building, and store into the [fbBuilder].
|
|
|
|
@override
|
|
|
|
int finish(
|
|
|
|
fb.Builder fbBuilder) {
|
|
|
|
assert(fbBuilder != null);
|
|
|
|
|
|
|
|
fbBuilder.startTable();
|
|
|
|
return fbBuilder.endTable();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Convenience method to serialize to byte list.
|
|
|
|
@override
|
|
|
|
Uint8List toBytes([String fileIdentifier]) {
|
|
|
|
fb.Builder fbBuilder = new fb.Builder();
|
|
|
|
int offset = finish(fbBuilder);
|
|
|
|
return fbBuilder.finish(offset, fileIdentifier);
|
|
|
|
}
|
|
|
|
}
|