1
0
mirror of https://github.com/google/flatbuffers.git synced 2025-04-11 00:03:54 +08:00
Björn Harrtell 408e4db4af
[TS] Add Build TS to CI jobs ()
* Add Build TS to CI jobs

* Add npm compile step

* Fix syntax

* Add required code gen for TS

* Exit on failure

* Make TS code gen identical to test run

* Remove duplicate TS code gen artifacts

* Remove bad gitignore

* Forgot parts of generate_code and make sure same settings for test run

* Don't forget about the bat

* Try and fix flatc args

* Another attempt to fix args

* Fix typo

* Commit up to date code gen

* Another attempt to fix sh/bat

* Move -o param to after -I

* Commit missing code gen file

* Fix grpc code gen and test

* Another grpc code gen fix

* Rework to not use ts folder

* Fix env vars in bat and make less churn

* Move TS code gen to dedicated folder

* Fix transpilation output folder and module paths

* Fixes to code gen

* Include generated js

* Moved ts code gen

* Remove test ts code gen folder
2021-04-12 10:41:59 -07:00

62 lines
2.1 KiB
JavaScript

// automatically generated by the FlatBuffers compiler, do not modify
import { Ability } from '../../my-game/example/ability';
import { Test } from '../../my-game/example/test';
export class StructOfStructs {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
a(obj) {
return (obj || new Ability()).__init(this.bb_pos, this.bb);
}
b(obj) {
return (obj || new Test()).__init(this.bb_pos + 8, this.bb);
}
c(obj) {
return (obj || new Ability()).__init(this.bb_pos + 12, this.bb);
}
static getFullyQualifiedName() {
return 'MyGame.Example.StructOfStructs';
}
static sizeOf() {
return 20;
}
static createStructOfStructs(builder, a_id, a_distance, b_a, b_b, c_id, c_distance) {
builder.prep(4, 20);
builder.prep(4, 8);
builder.writeInt32(c_distance);
builder.writeInt32(c_id);
builder.prep(2, 4);
builder.pad(1);
builder.writeInt8(b_b);
builder.writeInt16(b_a);
builder.prep(4, 8);
builder.writeInt32(a_distance);
builder.writeInt32(a_id);
return builder.offset();
}
unpack() {
return new StructOfStructsT((this.a() !== null ? this.a().unpack() : null), (this.b() !== null ? this.b().unpack() : null), (this.c() !== null ? this.c().unpack() : null));
}
unpackTo(_o) {
_o.a = (this.a() !== null ? this.a().unpack() : null);
_o.b = (this.b() !== null ? this.b().unpack() : null);
_o.c = (this.c() !== null ? this.c().unpack() : null);
}
}
export class StructOfStructsT {
constructor(a = null, b = null, c = null) {
this.a = a;
this.b = b;
this.c = c;
}
pack(builder) {
return StructOfStructs.createStructOfStructs(builder, (this.a === null ? 0 : this.a.id), (this.a === null ? 0 : this.a.distance), (this.b === null ? 0 : this.b.a), (this.b === null ? 0 : this.b.b), (this.c === null ? 0 : this.c.id), (this.c === null ? 0 : this.c.distance));
}
}