Merge commit '0f6aab9da6fe982218a01f4a5b896e65fcced437' as 'third_party/flatbuffers'
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class Attacker implements flatbuffers.IUnpackableObject<AttackerT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Attacker;
|
||||
static getRootAsAttacker(bb: flatbuffers.ByteBuffer, obj?: Attacker): Attacker;
|
||||
static getSizePrefixedRootAsAttacker(bb: flatbuffers.ByteBuffer, obj?: Attacker): Attacker;
|
||||
swordAttackDamage(): number;
|
||||
mutate_sword_attack_damage(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startAttacker(builder: flatbuffers.Builder): void;
|
||||
static addSwordAttackDamage(builder: flatbuffers.Builder, swordAttackDamage: number): void;
|
||||
static endAttacker(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createAttacker(builder: flatbuffers.Builder, swordAttackDamage: number): flatbuffers.Offset;
|
||||
unpack(): AttackerT;
|
||||
unpackTo(_o: AttackerT): void;
|
||||
}
|
||||
export declare class AttackerT implements flatbuffers.IGeneratedObject {
|
||||
swordAttackDamage: number;
|
||||
constructor(swordAttackDamage?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export class Attacker {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsAttacker(bb, obj) {
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsAttacker(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
swordAttackDamage() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_sword_attack_damage(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'Attacker';
|
||||
}
|
||||
static startAttacker(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addSwordAttackDamage(builder, swordAttackDamage) {
|
||||
builder.addFieldInt32(0, swordAttackDamage, 0);
|
||||
}
|
||||
static endAttacker(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createAttacker(builder, swordAttackDamage) {
|
||||
Attacker.startAttacker(builder);
|
||||
Attacker.addSwordAttackDamage(builder, swordAttackDamage);
|
||||
return Attacker.endAttacker(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new AttackerT(this.swordAttackDamage());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.swordAttackDamage = this.swordAttackDamage();
|
||||
}
|
||||
}
|
||||
export class AttackerT {
|
||||
constructor(swordAttackDamage = 0) {
|
||||
this.swordAttackDamage = swordAttackDamage;
|
||||
}
|
||||
pack(builder) {
|
||||
return Attacker.createAttacker(builder, this.swordAttackDamage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class Attacker implements flatbuffers.IUnpackableObject<AttackerT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Attacker {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsAttacker(bb:flatbuffers.ByteBuffer, obj?:Attacker):Attacker {
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsAttacker(bb:flatbuffers.ByteBuffer, obj?:Attacker):Attacker {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
swordAttackDamage():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_sword_attack_damage(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'Attacker';
|
||||
}
|
||||
|
||||
static startAttacker(builder:flatbuffers.Builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
|
||||
static addSwordAttackDamage(builder:flatbuffers.Builder, swordAttackDamage:number) {
|
||||
builder.addFieldInt32(0, swordAttackDamage, 0);
|
||||
}
|
||||
|
||||
static endAttacker(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createAttacker(builder:flatbuffers.Builder, swordAttackDamage:number):flatbuffers.Offset {
|
||||
Attacker.startAttacker(builder);
|
||||
Attacker.addSwordAttackDamage(builder, swordAttackDamage);
|
||||
return Attacker.endAttacker(builder);
|
||||
}
|
||||
|
||||
unpack(): AttackerT {
|
||||
return new AttackerT(
|
||||
this.swordAttackDamage()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: AttackerT): void {
|
||||
_o.swordAttackDamage = this.swordAttackDamage();
|
||||
}
|
||||
}
|
||||
|
||||
export class AttackerT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public swordAttackDamage: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return Attacker.createAttacker(builder,
|
||||
this.swordAttackDamage
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class BookReader implements flatbuffers.IUnpackableObject<BookReaderT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): BookReader;
|
||||
booksRead(): number;
|
||||
mutate_books_read(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static sizeOf(): number;
|
||||
static createBookReader(builder: flatbuffers.Builder, books_read: number): flatbuffers.Offset;
|
||||
unpack(): BookReaderT;
|
||||
unpackTo(_o: BookReaderT): void;
|
||||
}
|
||||
export declare class BookReaderT implements flatbuffers.IGeneratedObject {
|
||||
booksRead: number;
|
||||
constructor(booksRead?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export class BookReader {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
booksRead() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_books_read(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'BookReader';
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createBookReader(builder, books_read) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(books_read);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new BookReaderT(this.booksRead());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.booksRead = this.booksRead();
|
||||
}
|
||||
}
|
||||
export class BookReaderT {
|
||||
constructor(booksRead = 0) {
|
||||
this.booksRead = booksRead;
|
||||
}
|
||||
pack(builder) {
|
||||
return BookReader.createBookReader(builder, this.booksRead);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class BookReader implements flatbuffers.IUnpackableObject<BookReaderT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):BookReader {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
booksRead():number {
|
||||
return this.bb!.readInt32(this.bb_pos);
|
||||
}
|
||||
|
||||
mutate_books_read(value:number):boolean {
|
||||
this.bb!.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'BookReader';
|
||||
}
|
||||
|
||||
static sizeOf():number {
|
||||
return 4;
|
||||
}
|
||||
|
||||
static createBookReader(builder:flatbuffers.Builder, books_read: number):flatbuffers.Offset {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(books_read);
|
||||
return builder.offset();
|
||||
}
|
||||
|
||||
|
||||
unpack(): BookReaderT {
|
||||
return new BookReaderT(
|
||||
this.booksRead()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: BookReaderT): void {
|
||||
_o.booksRead = this.booksRead();
|
||||
}
|
||||
}
|
||||
|
||||
export class BookReaderT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public booksRead: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return BookReader.createBookReader(builder,
|
||||
this.booksRead
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Attacker } from './attacker.js';
|
||||
import { BookReader } from './book-reader.js';
|
||||
import { Rapunzel } from './rapunzel.js';
|
||||
export declare enum Character {
|
||||
NONE = 0,
|
||||
MuLan = 1,
|
||||
Rapunzel = 2,
|
||||
Belle = 3,
|
||||
BookFan = 4,
|
||||
Other = 5,
|
||||
Unused = 6
|
||||
}
|
||||
export declare function unionToCharacter(type: Character, accessor: (obj: Attacker | BookReader | Rapunzel | string) => Attacker | BookReader | Rapunzel | string | null): Attacker | BookReader | Rapunzel | string | null;
|
||||
export declare function unionListToCharacter(type: Character, accessor: (index: number, obj: Attacker | BookReader | Rapunzel | string) => Attacker | BookReader | Rapunzel | string | null, index: number): Attacker | BookReader | Rapunzel | string | null;
|
||||
@@ -0,0 +1,39 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import { Attacker } from './attacker.js';
|
||||
import { BookReader } from './book-reader.js';
|
||||
import { Rapunzel } from './rapunzel.js';
|
||||
export var Character;
|
||||
(function (Character) {
|
||||
Character[Character["NONE"] = 0] = "NONE";
|
||||
Character[Character["MuLan"] = 1] = "MuLan";
|
||||
Character[Character["Rapunzel"] = 2] = "Rapunzel";
|
||||
Character[Character["Belle"] = 3] = "Belle";
|
||||
Character[Character["BookFan"] = 4] = "BookFan";
|
||||
Character[Character["Other"] = 5] = "Other";
|
||||
Character[Character["Unused"] = 6] = "Unused";
|
||||
})(Character || (Character = {}));
|
||||
export function unionToCharacter(type, accessor) {
|
||||
switch (Character[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'MuLan': return accessor(new Attacker());
|
||||
case 'Rapunzel': return accessor(new Rapunzel());
|
||||
case 'Belle': return accessor(new BookReader());
|
||||
case 'BookFan': return accessor(new BookReader());
|
||||
case 'Other': return accessor('');
|
||||
case 'Unused': return accessor('');
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
export function unionListToCharacter(type, accessor, index) {
|
||||
switch (Character[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'MuLan': return accessor(index, new Attacker());
|
||||
case 'Rapunzel': return accessor(index, new Rapunzel());
|
||||
case 'Belle': return accessor(index, new BookReader());
|
||||
case 'BookFan': return accessor(index, new BookReader());
|
||||
case 'Other': return accessor(index, '');
|
||||
case 'Unused': return accessor(index, '');
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import { Attacker, AttackerT } from './attacker.js';
|
||||
import { BookReader, BookReaderT } from './book-reader.js';
|
||||
import { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
|
||||
|
||||
export enum Character {
|
||||
NONE = 0,
|
||||
MuLan = 1,
|
||||
Rapunzel = 2,
|
||||
Belle = 3,
|
||||
BookFan = 4,
|
||||
Other = 5,
|
||||
Unused = 6
|
||||
}
|
||||
|
||||
export function unionToCharacter(
|
||||
type: Character,
|
||||
accessor: (obj:Attacker|BookReader|Rapunzel|string) => Attacker|BookReader|Rapunzel|string|null
|
||||
): Attacker|BookReader|Rapunzel|string|null {
|
||||
switch(Character[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'MuLan': return accessor(new Attacker())! as Attacker;
|
||||
case 'Rapunzel': return accessor(new Rapunzel())! as Rapunzel;
|
||||
case 'Belle': return accessor(new BookReader())! as BookReader;
|
||||
case 'BookFan': return accessor(new BookReader())! as BookReader;
|
||||
case 'Other': return accessor('') as string;
|
||||
case 'Unused': return accessor('') as string;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function unionListToCharacter(
|
||||
type: Character,
|
||||
accessor: (index: number, obj:Attacker|BookReader|Rapunzel|string) => Attacker|BookReader|Rapunzel|string|null,
|
||||
index: number
|
||||
): Attacker|BookReader|Rapunzel|string|null {
|
||||
switch(Character[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'MuLan': return accessor(index, new Attacker())! as Attacker;
|
||||
case 'Rapunzel': return accessor(index, new Rapunzel())! as Rapunzel;
|
||||
case 'Belle': return accessor(index, new BookReader())! as BookReader;
|
||||
case 'BookFan': return accessor(index, new BookReader())! as BookReader;
|
||||
case 'Other': return accessor(index, '') as string;
|
||||
case 'Unused': return accessor(index, '') as string;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class FallingTub implements flatbuffers.IUnpackableObject<FallingTubT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): FallingTub;
|
||||
weight(): number;
|
||||
mutate_weight(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static sizeOf(): number;
|
||||
static createFallingTub(builder: flatbuffers.Builder, weight: number): flatbuffers.Offset;
|
||||
unpack(): FallingTubT;
|
||||
unpackTo(_o: FallingTubT): void;
|
||||
}
|
||||
export declare class FallingTubT implements flatbuffers.IGeneratedObject {
|
||||
weight: number;
|
||||
constructor(weight?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export class FallingTub {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
weight() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_weight(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'FallingTub';
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createFallingTub(builder, weight) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(weight);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new FallingTubT(this.weight());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.weight = this.weight();
|
||||
}
|
||||
}
|
||||
export class FallingTubT {
|
||||
constructor(weight = 0) {
|
||||
this.weight = weight;
|
||||
}
|
||||
pack(builder) {
|
||||
return FallingTub.createFallingTub(builder, this.weight);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class FallingTub implements flatbuffers.IUnpackableObject<FallingTubT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):FallingTub {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
weight():number {
|
||||
return this.bb!.readInt32(this.bb_pos);
|
||||
}
|
||||
|
||||
mutate_weight(value:number):boolean {
|
||||
this.bb!.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'FallingTub';
|
||||
}
|
||||
|
||||
static sizeOf():number {
|
||||
return 4;
|
||||
}
|
||||
|
||||
static createFallingTub(builder:flatbuffers.Builder, weight: number):flatbuffers.Offset {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(weight);
|
||||
return builder.offset();
|
||||
}
|
||||
|
||||
|
||||
unpack(): FallingTubT {
|
||||
return new FallingTubT(
|
||||
this.weight()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: FallingTubT): void {
|
||||
_o.weight = this.weight();
|
||||
}
|
||||
}
|
||||
|
||||
export class FallingTubT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public weight: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return FallingTub.createFallingTub(builder,
|
||||
this.weight
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { FallingTub } from './falling-tub.js';
|
||||
import { HandFan } from './hand-fan.js';
|
||||
export declare enum Gadget {
|
||||
NONE = 0,
|
||||
FallingTub = 1,
|
||||
HandFan = 2
|
||||
}
|
||||
export declare function unionToGadget(type: Gadget, accessor: (obj: FallingTub | HandFan) => FallingTub | HandFan | null): FallingTub | HandFan | null;
|
||||
export declare function unionListToGadget(type: Gadget, accessor: (index: number, obj: FallingTub | HandFan) => FallingTub | HandFan | null, index: number): FallingTub | HandFan | null;
|
||||
@@ -0,0 +1,26 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import { FallingTub } from './falling-tub.js';
|
||||
import { HandFan } from './hand-fan.js';
|
||||
export var Gadget;
|
||||
(function (Gadget) {
|
||||
Gadget[Gadget["NONE"] = 0] = "NONE";
|
||||
Gadget[Gadget["FallingTub"] = 1] = "FallingTub";
|
||||
Gadget[Gadget["HandFan"] = 2] = "HandFan";
|
||||
})(Gadget || (Gadget = {}));
|
||||
export function unionToGadget(type, accessor) {
|
||||
switch (Gadget[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'FallingTub': return accessor(new FallingTub());
|
||||
case 'HandFan': return accessor(new HandFan());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
export function unionListToGadget(type, accessor, index) {
|
||||
switch (Gadget[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'FallingTub': return accessor(index, new FallingTub());
|
||||
case 'HandFan': return accessor(index, new HandFan());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
import { HandFan, HandFanT } from './hand-fan.js';
|
||||
|
||||
|
||||
export enum Gadget {
|
||||
NONE = 0,
|
||||
FallingTub = 1,
|
||||
HandFan = 2
|
||||
}
|
||||
|
||||
export function unionToGadget(
|
||||
type: Gadget,
|
||||
accessor: (obj:FallingTub|HandFan) => FallingTub|HandFan|null
|
||||
): FallingTub|HandFan|null {
|
||||
switch(Gadget[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'FallingTub': return accessor(new FallingTub())! as FallingTub;
|
||||
case 'HandFan': return accessor(new HandFan())! as HandFan;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function unionListToGadget(
|
||||
type: Gadget,
|
||||
accessor: (index: number, obj:FallingTub|HandFan) => FallingTub|HandFan|null,
|
||||
index: number
|
||||
): FallingTub|HandFan|null {
|
||||
switch(Gadget[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'FallingTub': return accessor(index, new FallingTub())! as FallingTub;
|
||||
case 'HandFan': return accessor(index, new HandFan())! as HandFan;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class HandFan implements flatbuffers.IUnpackableObject<HandFanT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): HandFan;
|
||||
static getRootAsHandFan(bb: flatbuffers.ByteBuffer, obj?: HandFan): HandFan;
|
||||
static getSizePrefixedRootAsHandFan(bb: flatbuffers.ByteBuffer, obj?: HandFan): HandFan;
|
||||
length(): number;
|
||||
mutate_length(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startHandFan(builder: flatbuffers.Builder): void;
|
||||
static addLength(builder: flatbuffers.Builder, length: number): void;
|
||||
static endHandFan(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createHandFan(builder: flatbuffers.Builder, length: number): flatbuffers.Offset;
|
||||
unpack(): HandFanT;
|
||||
unpackTo(_o: HandFanT): void;
|
||||
}
|
||||
export declare class HandFanT implements flatbuffers.IGeneratedObject {
|
||||
length: number;
|
||||
constructor(length?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export class HandFan {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsHandFan(bb, obj) {
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsHandFan(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
length() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_length(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'HandFan';
|
||||
}
|
||||
static startHandFan(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addLength(builder, length) {
|
||||
builder.addFieldInt32(0, length, 0);
|
||||
}
|
||||
static endHandFan(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createHandFan(builder, length) {
|
||||
HandFan.startHandFan(builder);
|
||||
HandFan.addLength(builder, length);
|
||||
return HandFan.endHandFan(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new HandFanT(this.length());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.length = this.length();
|
||||
}
|
||||
}
|
||||
export class HandFanT {
|
||||
constructor(length = 0) {
|
||||
this.length = length;
|
||||
}
|
||||
pack(builder) {
|
||||
return HandFan.createHandFan(builder, this.length);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class HandFan implements flatbuffers.IUnpackableObject<HandFanT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):HandFan {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsHandFan(bb:flatbuffers.ByteBuffer, obj?:HandFan):HandFan {
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsHandFan(bb:flatbuffers.ByteBuffer, obj?:HandFan):HandFan {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
length():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_length(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'HandFan';
|
||||
}
|
||||
|
||||
static startHandFan(builder:flatbuffers.Builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
|
||||
static addLength(builder:flatbuffers.Builder, length:number) {
|
||||
builder.addFieldInt32(0, length, 0);
|
||||
}
|
||||
|
||||
static endHandFan(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createHandFan(builder:flatbuffers.Builder, length:number):flatbuffers.Offset {
|
||||
HandFan.startHandFan(builder);
|
||||
HandFan.addLength(builder, length);
|
||||
return HandFan.endHandFan(builder);
|
||||
}
|
||||
|
||||
unpack(): HandFanT {
|
||||
return new HandFanT(
|
||||
this.length()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: HandFanT): void {
|
||||
_o.length = this.length();
|
||||
}
|
||||
}
|
||||
|
||||
export class HandFanT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public length: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return HandFan.createHandFan(builder,
|
||||
this.length
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { AttackerT } from './attacker.js';
|
||||
import { BookReaderT } from './book-reader.js';
|
||||
import { Character } from './character.js';
|
||||
import { RapunzelT } from './rapunzel.js';
|
||||
export declare class Movie implements flatbuffers.IUnpackableObject<MovieT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Movie;
|
||||
static getRootAsMovie(bb: flatbuffers.ByteBuffer, obj?: Movie): Movie;
|
||||
static getSizePrefixedRootAsMovie(bb: flatbuffers.ByteBuffer, obj?: Movie): Movie;
|
||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
||||
mainCharacterType(): Character;
|
||||
mainCharacter<T extends flatbuffers.Table>(obj: any | string): any | string | null;
|
||||
charactersType(index: number): Character | null;
|
||||
charactersTypeLength(): number;
|
||||
charactersTypeArray(): Uint8Array | null;
|
||||
characters(index: number, obj: any | string): any | string | null;
|
||||
charactersLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startMovie(builder: flatbuffers.Builder): void;
|
||||
static addMainCharacterType(builder: flatbuffers.Builder, mainCharacterType: Character): void;
|
||||
static addMainCharacter(builder: flatbuffers.Builder, mainCharacterOffset: flatbuffers.Offset): void;
|
||||
static addCharactersType(builder: flatbuffers.Builder, charactersTypeOffset: flatbuffers.Offset): void;
|
||||
static createCharactersTypeVector(builder: flatbuffers.Builder, data: Character[]): flatbuffers.Offset;
|
||||
static startCharactersTypeVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addCharacters(builder: flatbuffers.Builder, charactersOffset: flatbuffers.Offset): void;
|
||||
static createCharactersVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startCharactersVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static endMovie(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static finishMovieBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
static finishSizePrefixedMovieBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
static createMovie(builder: flatbuffers.Builder, mainCharacterType: Character, mainCharacterOffset: flatbuffers.Offset, charactersTypeOffset: flatbuffers.Offset, charactersOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): MovieT;
|
||||
unpackTo(_o: MovieT): void;
|
||||
}
|
||||
export declare class MovieT implements flatbuffers.IGeneratedObject {
|
||||
mainCharacterType: Character;
|
||||
mainCharacter: AttackerT | BookReaderT | RapunzelT | string | null;
|
||||
charactersType: (Character)[];
|
||||
characters: (AttackerT | BookReaderT | RapunzelT | string)[];
|
||||
constructor(mainCharacterType?: Character, mainCharacter?: AttackerT | BookReaderT | RapunzelT | string | null, charactersType?: (Character)[], characters?: (AttackerT | BookReaderT | RapunzelT | string)[]);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Character, unionToCharacter, unionListToCharacter } from './character.js';
|
||||
export class Movie {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsMovie(bb, obj) {
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsMovie(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier('MOVI');
|
||||
}
|
||||
mainCharacterType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : Character.NONE;
|
||||
}
|
||||
mainCharacter(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__union_with_string(obj, this.bb_pos + offset) : null;
|
||||
}
|
||||
charactersType(index) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
||||
}
|
||||
charactersTypeLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
charactersTypeArray() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
}
|
||||
characters(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__union_with_string(obj, this.bb.__vector(this.bb_pos + offset) + index * 4) : null;
|
||||
}
|
||||
charactersLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'Movie';
|
||||
}
|
||||
static startMovie(builder) {
|
||||
builder.startObject(4);
|
||||
}
|
||||
static addMainCharacterType(builder, mainCharacterType) {
|
||||
builder.addFieldInt8(0, mainCharacterType, Character.NONE);
|
||||
}
|
||||
static addMainCharacter(builder, mainCharacterOffset) {
|
||||
builder.addFieldOffset(1, mainCharacterOffset, 0);
|
||||
}
|
||||
static addCharactersType(builder, charactersTypeOffset) {
|
||||
builder.addFieldOffset(2, charactersTypeOffset, 0);
|
||||
}
|
||||
static createCharactersTypeVector(builder, data) {
|
||||
builder.startVector(1, data.length, 1);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addInt8(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
static startCharactersTypeVector(builder, numElems) {
|
||||
builder.startVector(1, numElems, 1);
|
||||
}
|
||||
static addCharacters(builder, charactersOffset) {
|
||||
builder.addFieldOffset(3, charactersOffset, 0);
|
||||
}
|
||||
static createCharactersVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
static startCharactersVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endMovie(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static finishMovieBuffer(builder, offset) {
|
||||
builder.finish(offset, 'MOVI');
|
||||
}
|
||||
static finishSizePrefixedMovieBuffer(builder, offset) {
|
||||
builder.finish(offset, 'MOVI', true);
|
||||
}
|
||||
static createMovie(builder, mainCharacterType, mainCharacterOffset, charactersTypeOffset, charactersOffset) {
|
||||
Movie.startMovie(builder);
|
||||
Movie.addMainCharacterType(builder, mainCharacterType);
|
||||
Movie.addMainCharacter(builder, mainCharacterOffset);
|
||||
Movie.addCharactersType(builder, charactersTypeOffset);
|
||||
Movie.addCharacters(builder, charactersOffset);
|
||||
return Movie.endMovie(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new MovieT(this.mainCharacterType(), (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === 'string') {
|
||||
return temp;
|
||||
}
|
||||
return temp.unpack();
|
||||
})(), this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength()), (() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === 'NONE') {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if (temp === null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof temp === 'string') {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.mainCharacterType = this.mainCharacterType();
|
||||
_o.mainCharacter = (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === 'string') {
|
||||
return temp;
|
||||
}
|
||||
return temp.unpack();
|
||||
})();
|
||||
_o.charactersType = this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength());
|
||||
_o.characters = (() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === 'NONE') {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if (temp === null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof temp === 'string') {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})();
|
||||
}
|
||||
}
|
||||
export class MovieT {
|
||||
constructor(mainCharacterType = Character.NONE, mainCharacter = null, charactersType = [], characters = []) {
|
||||
this.mainCharacterType = mainCharacterType;
|
||||
this.mainCharacter = mainCharacter;
|
||||
this.charactersType = charactersType;
|
||||
this.characters = characters;
|
||||
}
|
||||
pack(builder) {
|
||||
const mainCharacter = builder.createObjectOffset(this.mainCharacter);
|
||||
const charactersType = Movie.createCharactersTypeVector(builder, this.charactersType);
|
||||
const characters = Movie.createCharactersVector(builder, builder.createObjectOffsetList(this.characters));
|
||||
return Movie.createMovie(builder, this.mainCharacterType, mainCharacter, charactersType, characters);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Attacker, AttackerT } from './attacker.js';
|
||||
import { BookReader, BookReaderT } from './book-reader.js';
|
||||
import { Character, unionToCharacter, unionListToCharacter } from './character.js';
|
||||
import { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
|
||||
|
||||
export class Movie implements flatbuffers.IUnpackableObject<MovieT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Movie {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsMovie(bb:flatbuffers.ByteBuffer, obj?:Movie):Movie {
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsMovie(bb:flatbuffers.ByteBuffer, obj?:Movie):Movie {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
|
||||
return bb.__has_identifier('MOVI');
|
||||
}
|
||||
|
||||
mainCharacterType():Character {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readUint8(this.bb_pos + offset) : Character.NONE;
|
||||
}
|
||||
|
||||
mainCharacter<T extends flatbuffers.Table>(obj:any|string):any|string|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__union_with_string(obj, this.bb_pos + offset) : null;
|
||||
}
|
||||
|
||||
charactersType(index: number):Character|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
|
||||
}
|
||||
|
||||
charactersTypeLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
charactersTypeArray():Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
||||
}
|
||||
|
||||
characters(index: number, obj:any|string):any|string|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__union_with_string(obj, this.bb!.__vector(this.bb_pos + offset) + index * 4) : null;
|
||||
}
|
||||
|
||||
charactersLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'Movie';
|
||||
}
|
||||
|
||||
static startMovie(builder:flatbuffers.Builder) {
|
||||
builder.startObject(4);
|
||||
}
|
||||
|
||||
static addMainCharacterType(builder:flatbuffers.Builder, mainCharacterType:Character) {
|
||||
builder.addFieldInt8(0, mainCharacterType, Character.NONE);
|
||||
}
|
||||
|
||||
static addMainCharacter(builder:flatbuffers.Builder, mainCharacterOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, mainCharacterOffset, 0);
|
||||
}
|
||||
|
||||
static addCharactersType(builder:flatbuffers.Builder, charactersTypeOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, charactersTypeOffset, 0);
|
||||
}
|
||||
|
||||
static createCharactersTypeVector(builder:flatbuffers.Builder, data:Character[]):flatbuffers.Offset {
|
||||
builder.startVector(1, data.length, 1);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addInt8(data[i]!);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startCharactersTypeVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(1, numElems, 1);
|
||||
}
|
||||
|
||||
static addCharacters(builder:flatbuffers.Builder, charactersOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, charactersOffset, 0);
|
||||
}
|
||||
|
||||
static createCharactersVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]!);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startCharactersVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static endMovie(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static finishMovieBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset, 'MOVI');
|
||||
}
|
||||
|
||||
static finishSizePrefixedMovieBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset, 'MOVI', true);
|
||||
}
|
||||
|
||||
static createMovie(builder:flatbuffers.Builder, mainCharacterType:Character, mainCharacterOffset:flatbuffers.Offset, charactersTypeOffset:flatbuffers.Offset, charactersOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
Movie.startMovie(builder);
|
||||
Movie.addMainCharacterType(builder, mainCharacterType);
|
||||
Movie.addMainCharacter(builder, mainCharacterOffset);
|
||||
Movie.addCharactersType(builder, charactersTypeOffset);
|
||||
Movie.addCharacters(builder, charactersOffset);
|
||||
return Movie.endMovie(builder);
|
||||
}
|
||||
|
||||
unpack(): MovieT {
|
||||
return new MovieT(
|
||||
this.mainCharacterType(),
|
||||
(() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if(temp === null) { return null; }
|
||||
if(typeof temp === 'string') { return temp; }
|
||||
return temp.unpack()
|
||||
})(),
|
||||
this.bb!.createScalarList<Character>(this.charactersType.bind(this), this.charactersTypeLength()),
|
||||
(() => {
|
||||
const ret: (AttackerT|BookReaderT|RapunzelT|string)[] = [];
|
||||
for(let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if(targetEnum === null || Character[targetEnum!] === 'NONE') { continue; }
|
||||
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if(temp === null) { continue; }
|
||||
if(typeof temp === 'string') { ret.push(temp); continue; }
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: MovieT): void {
|
||||
_o.mainCharacterType = this.mainCharacterType();
|
||||
_o.mainCharacter = (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if(temp === null) { return null; }
|
||||
if(typeof temp === 'string') { return temp; }
|
||||
return temp.unpack()
|
||||
})();
|
||||
_o.charactersType = this.bb!.createScalarList<Character>(this.charactersType.bind(this), this.charactersTypeLength());
|
||||
_o.characters = (() => {
|
||||
const ret: (AttackerT|BookReaderT|RapunzelT|string)[] = [];
|
||||
for(let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if(targetEnum === null || Character[targetEnum!] === 'NONE') { continue; }
|
||||
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if(temp === null) { continue; }
|
||||
if(typeof temp === 'string') { ret.push(temp); continue; }
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
export class MovieT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public mainCharacterType: Character = Character.NONE,
|
||||
public mainCharacter: AttackerT|BookReaderT|RapunzelT|string|null = null,
|
||||
public charactersType: (Character)[] = [],
|
||||
public characters: (AttackerT|BookReaderT|RapunzelT|string)[] = []
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const mainCharacter = builder.createObjectOffset(this.mainCharacter);
|
||||
const charactersType = Movie.createCharactersTypeVector(builder, this.charactersType);
|
||||
const characters = Movie.createCharactersVector(builder, builder.createObjectOffsetList(this.characters));
|
||||
|
||||
return Movie.createMovie(builder,
|
||||
this.mainCharacterType,
|
||||
mainCharacter,
|
||||
charactersType,
|
||||
characters
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class Rapunzel implements flatbuffers.IUnpackableObject<RapunzelT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Rapunzel;
|
||||
hairLength(): number;
|
||||
mutate_hair_length(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static sizeOf(): number;
|
||||
static createRapunzel(builder: flatbuffers.Builder, hair_length: number): flatbuffers.Offset;
|
||||
unpack(): RapunzelT;
|
||||
unpackTo(_o: RapunzelT): void;
|
||||
}
|
||||
export declare class RapunzelT implements flatbuffers.IGeneratedObject {
|
||||
hairLength: number;
|
||||
constructor(hairLength?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export class Rapunzel {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
hairLength() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_hair_length(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'Rapunzel';
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createRapunzel(builder, hair_length) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(hair_length);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new RapunzelT(this.hairLength());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.hairLength = this.hairLength();
|
||||
}
|
||||
}
|
||||
export class RapunzelT {
|
||||
constructor(hairLength = 0) {
|
||||
this.hairLength = hairLength;
|
||||
}
|
||||
pack(builder) {
|
||||
return Rapunzel.createRapunzel(builder, this.hairLength);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class Rapunzel implements flatbuffers.IUnpackableObject<RapunzelT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Rapunzel {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
hairLength():number {
|
||||
return this.bb!.readInt32(this.bb_pos);
|
||||
}
|
||||
|
||||
mutate_hair_length(value:number):boolean {
|
||||
this.bb!.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'Rapunzel';
|
||||
}
|
||||
|
||||
static sizeOf():number {
|
||||
return 4;
|
||||
}
|
||||
|
||||
static createRapunzel(builder:flatbuffers.Builder, hair_length: number):flatbuffers.Offset {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(hair_length);
|
||||
return builder.offset();
|
||||
}
|
||||
|
||||
|
||||
unpack(): RapunzelT {
|
||||
return new RapunzelT(
|
||||
this.hairLength()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: RapunzelT): void {
|
||||
_o.hairLength = this.hairLength();
|
||||
}
|
||||
}
|
||||
|
||||
export class RapunzelT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public hairLength: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return Rapunzel.createRapunzel(builder,
|
||||
this.hairLength
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
@@ -0,0 +1,10 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
@@ -0,0 +1,12 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
@@ -0,0 +1,558 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// union_vector/union_vector.ts
|
||||
var union_vector_exports = {};
|
||||
__export(union_vector_exports, {
|
||||
Attacker: () => Attacker,
|
||||
AttackerT: () => AttackerT,
|
||||
BookReader: () => BookReader,
|
||||
BookReaderT: () => BookReaderT,
|
||||
Character: () => Character,
|
||||
FallingTub: () => FallingTub,
|
||||
FallingTubT: () => FallingTubT,
|
||||
Gadget: () => Gadget,
|
||||
HandFan: () => HandFan,
|
||||
HandFanT: () => HandFanT,
|
||||
Movie: () => Movie,
|
||||
MovieT: () => MovieT,
|
||||
Rapunzel: () => Rapunzel,
|
||||
RapunzelT: () => RapunzelT
|
||||
});
|
||||
module.exports = __toCommonJS(union_vector_exports);
|
||||
|
||||
// union_vector/attacker.js
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var Attacker = class _Attacker {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsAttacker(bb, obj) {
|
||||
return (obj || new _Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsAttacker(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new _Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
swordAttackDamage() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_sword_attack_damage(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "Attacker";
|
||||
}
|
||||
static startAttacker(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addSwordAttackDamage(builder, swordAttackDamage) {
|
||||
builder.addFieldInt32(0, swordAttackDamage, 0);
|
||||
}
|
||||
static endAttacker(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createAttacker(builder, swordAttackDamage) {
|
||||
_Attacker.startAttacker(builder);
|
||||
_Attacker.addSwordAttackDamage(builder, swordAttackDamage);
|
||||
return _Attacker.endAttacker(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new AttackerT(this.swordAttackDamage());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.swordAttackDamage = this.swordAttackDamage();
|
||||
}
|
||||
};
|
||||
var AttackerT = class {
|
||||
constructor(swordAttackDamage = 0) {
|
||||
this.swordAttackDamage = swordAttackDamage;
|
||||
}
|
||||
pack(builder) {
|
||||
return Attacker.createAttacker(builder, this.swordAttackDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/book-reader.js
|
||||
var BookReader = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
booksRead() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_books_read(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "BookReader";
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createBookReader(builder, books_read) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(books_read);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new BookReaderT(this.booksRead());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.booksRead = this.booksRead();
|
||||
}
|
||||
};
|
||||
var BookReaderT = class {
|
||||
constructor(booksRead = 0) {
|
||||
this.booksRead = booksRead;
|
||||
}
|
||||
pack(builder) {
|
||||
return BookReader.createBookReader(builder, this.booksRead);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/rapunzel.js
|
||||
var Rapunzel = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
hairLength() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_hair_length(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "Rapunzel";
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createRapunzel(builder, hair_length) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(hair_length);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new RapunzelT(this.hairLength());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.hairLength = this.hairLength();
|
||||
}
|
||||
};
|
||||
var RapunzelT = class {
|
||||
constructor(hairLength = 0) {
|
||||
this.hairLength = hairLength;
|
||||
}
|
||||
pack(builder) {
|
||||
return Rapunzel.createRapunzel(builder, this.hairLength);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/character.js
|
||||
var Character;
|
||||
(function(Character2) {
|
||||
Character2[Character2["NONE"] = 0] = "NONE";
|
||||
Character2[Character2["MuLan"] = 1] = "MuLan";
|
||||
Character2[Character2["Rapunzel"] = 2] = "Rapunzel";
|
||||
Character2[Character2["Belle"] = 3] = "Belle";
|
||||
Character2[Character2["BookFan"] = 4] = "BookFan";
|
||||
Character2[Character2["Other"] = 5] = "Other";
|
||||
Character2[Character2["Unused"] = 6] = "Unused";
|
||||
})(Character || (Character = {}));
|
||||
function unionToCharacter(type, accessor) {
|
||||
switch (Character[type]) {
|
||||
case "NONE":
|
||||
return null;
|
||||
case "MuLan":
|
||||
return accessor(new Attacker());
|
||||
case "Rapunzel":
|
||||
return accessor(new Rapunzel());
|
||||
case "Belle":
|
||||
return accessor(new BookReader());
|
||||
case "BookFan":
|
||||
return accessor(new BookReader());
|
||||
case "Other":
|
||||
return accessor("");
|
||||
case "Unused":
|
||||
return accessor("");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function unionListToCharacter(type, accessor, index) {
|
||||
switch (Character[type]) {
|
||||
case "NONE":
|
||||
return null;
|
||||
case "MuLan":
|
||||
return accessor(index, new Attacker());
|
||||
case "Rapunzel":
|
||||
return accessor(index, new Rapunzel());
|
||||
case "Belle":
|
||||
return accessor(index, new BookReader());
|
||||
case "BookFan":
|
||||
return accessor(index, new BookReader());
|
||||
case "Other":
|
||||
return accessor(index, "");
|
||||
case "Unused":
|
||||
return accessor(index, "");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// union_vector/falling-tub.js
|
||||
var FallingTub = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
weight() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
}
|
||||
mutate_weight(value) {
|
||||
this.bb.writeInt32(this.bb_pos + 0, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "FallingTub";
|
||||
}
|
||||
static sizeOf() {
|
||||
return 4;
|
||||
}
|
||||
static createFallingTub(builder, weight) {
|
||||
builder.prep(4, 4);
|
||||
builder.writeInt32(weight);
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new FallingTubT(this.weight());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.weight = this.weight();
|
||||
}
|
||||
};
|
||||
var FallingTubT = class {
|
||||
constructor(weight = 0) {
|
||||
this.weight = weight;
|
||||
}
|
||||
pack(builder) {
|
||||
return FallingTub.createFallingTub(builder, this.weight);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/hand-fan.js
|
||||
var flatbuffers2 = __toESM(require("flatbuffers"), 1);
|
||||
var HandFan = class _HandFan {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsHandFan(bb, obj) {
|
||||
return (obj || new _HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsHandFan(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers2.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new _HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
length() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_length(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "HandFan";
|
||||
}
|
||||
static startHandFan(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addLength(builder, length) {
|
||||
builder.addFieldInt32(0, length, 0);
|
||||
}
|
||||
static endHandFan(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createHandFan(builder, length) {
|
||||
_HandFan.startHandFan(builder);
|
||||
_HandFan.addLength(builder, length);
|
||||
return _HandFan.endHandFan(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new HandFanT(this.length());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.length = this.length();
|
||||
}
|
||||
};
|
||||
var HandFanT = class {
|
||||
constructor(length = 0) {
|
||||
this.length = length;
|
||||
}
|
||||
pack(builder) {
|
||||
return HandFan.createHandFan(builder, this.length);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/gadget.js
|
||||
var Gadget;
|
||||
(function(Gadget2) {
|
||||
Gadget2[Gadget2["NONE"] = 0] = "NONE";
|
||||
Gadget2[Gadget2["FallingTub"] = 1] = "FallingTub";
|
||||
Gadget2[Gadget2["HandFan"] = 2] = "HandFan";
|
||||
})(Gadget || (Gadget = {}));
|
||||
|
||||
// union_vector/movie.js
|
||||
var flatbuffers3 = __toESM(require("flatbuffers"), 1);
|
||||
var Movie = class _Movie {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsMovie(bb, obj) {
|
||||
return (obj || new _Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsMovie(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers3.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new _Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier("MOVI");
|
||||
}
|
||||
mainCharacterType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : Character.NONE;
|
||||
}
|
||||
mainCharacter(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__union_with_string(obj, this.bb_pos + offset) : null;
|
||||
}
|
||||
charactersType(index) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
||||
}
|
||||
charactersTypeLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
charactersTypeArray() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
}
|
||||
characters(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__union_with_string(obj, this.bb.__vector(this.bb_pos + offset) + index * 4) : null;
|
||||
}
|
||||
charactersLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "Movie";
|
||||
}
|
||||
static startMovie(builder) {
|
||||
builder.startObject(4);
|
||||
}
|
||||
static addMainCharacterType(builder, mainCharacterType) {
|
||||
builder.addFieldInt8(0, mainCharacterType, Character.NONE);
|
||||
}
|
||||
static addMainCharacter(builder, mainCharacterOffset) {
|
||||
builder.addFieldOffset(1, mainCharacterOffset, 0);
|
||||
}
|
||||
static addCharactersType(builder, charactersTypeOffset) {
|
||||
builder.addFieldOffset(2, charactersTypeOffset, 0);
|
||||
}
|
||||
static createCharactersTypeVector(builder, data) {
|
||||
builder.startVector(1, data.length, 1);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addInt8(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
static startCharactersTypeVector(builder, numElems) {
|
||||
builder.startVector(1, numElems, 1);
|
||||
}
|
||||
static addCharacters(builder, charactersOffset) {
|
||||
builder.addFieldOffset(3, charactersOffset, 0);
|
||||
}
|
||||
static createCharactersVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
static startCharactersVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endMovie(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static finishMovieBuffer(builder, offset) {
|
||||
builder.finish(offset, "MOVI");
|
||||
}
|
||||
static finishSizePrefixedMovieBuffer(builder, offset) {
|
||||
builder.finish(offset, "MOVI", true);
|
||||
}
|
||||
static createMovie(builder, mainCharacterType, mainCharacterOffset, charactersTypeOffset, charactersOffset) {
|
||||
_Movie.startMovie(builder);
|
||||
_Movie.addMainCharacterType(builder, mainCharacterType);
|
||||
_Movie.addMainCharacter(builder, mainCharacterOffset);
|
||||
_Movie.addCharactersType(builder, charactersTypeOffset);
|
||||
_Movie.addCharacters(builder, charactersOffset);
|
||||
return _Movie.endMovie(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new MovieT(this.mainCharacterType(), (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
return temp;
|
||||
}
|
||||
return temp.unpack();
|
||||
})(), this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength()), (() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === "NONE") {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if (temp === null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.mainCharacterType = this.mainCharacterType();
|
||||
_o.mainCharacter = (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
return temp;
|
||||
}
|
||||
return temp.unpack();
|
||||
})();
|
||||
_o.charactersType = this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength());
|
||||
_o.characters = (() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === "NONE") {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if (temp === null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})();
|
||||
}
|
||||
};
|
||||
var MovieT = class {
|
||||
constructor(mainCharacterType = Character.NONE, mainCharacter = null, charactersType = [], characters = []) {
|
||||
this.mainCharacterType = mainCharacterType;
|
||||
this.mainCharacter = mainCharacter;
|
||||
this.charactersType = charactersType;
|
||||
this.characters = characters;
|
||||
}
|
||||
pack(builder) {
|
||||
const mainCharacter = builder.createObjectOffset(this.mainCharacter);
|
||||
const charactersType = Movie.createCharactersTypeVector(builder, this.charactersType);
|
||||
const characters = Movie.createCharactersVector(builder, builder.createObjectOffsetList(this.characters));
|
||||
return Movie.createMovie(builder, this.mainCharacterType, mainCharacter, charactersType, characters);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user