import { Event } from '../../game/event'; import { IAnimatable } from '../../game/ianimatable'; import { IHittable } from '../../game/ihittable'; import { IMovable } from '../../game/imovable'; import { IPlayable } from '../../game/iplayable'; import { IRenderable, Meshes } from '../../game/irenderable'; import { IScriptable } from '../../game/iscriptable'; import { Player } from '../../game/player'; import { IBinaryReader, Storage } from '../../io/ole-doc'; import { FRect3D } from '../../math/frect3d'; import { HitObject } from '../../physics/hit-object'; import { HitPlane } from '../../physics/hit-plane'; import { IRenderApi } from '../../render/irender-api'; import { Bumper } from '../bumper/bumper'; import { Collection } from '../collection/collection'; import { Decal } from '../decal/decal'; import { DispReel } from '../dispreel/dispreel'; import { Flasher } from '../flasher/flasher'; import { Flipper } from '../flipper/flipper'; import { Gate } from '../gate/gate'; import { HitTarget } from '../hit-target/hit-target'; import { Item } from '../item'; import { ItemData } from '../item-data'; import { ItemState } from '../item-state'; import { Kicker } from '../kicker/kicker'; import { Light } from '../light/light'; import { LightSeq } from '../lightseq/lightseq'; import { Material } from '../material'; import { Plunger } from '../plunger/plunger'; import { Primitive } from '../primitive/primitive'; import { Ramp } from '../ramp/ramp'; import { Rubber } from '../rubber/rubber'; import { Spinner } from '../spinner/spinner'; import { Surface } from '../surface/surface'; import { Textbox } from '../textbox/textbox'; import { Texture } from '../texture'; import { Timer } from '../timer/timer'; import { Trigger } from '../trigger/trigger'; import { TableApi } from './table-api'; import { TableData } from './table-data'; import { TableExportOptions } from './table-exporter'; import { LoadedTable, TableLoader } from './table-loader'; import { TableState } from './table-state'; import { TableUpdater } from './table-updater'; /** * A Visual Pinball table. * * This holds together all table elements of a .vpt/.vpx file. It's also * the entry point for parsing the file. */ export declare class Table implements IScriptable, IRenderable { readonly data?: TableData; readonly info?: { [key: string]: string; }; readonly items: { [key: string]: Item; }; readonly tableScript?: string; private readonly state?; private readonly updater?; private events?; private api?; private itemIndex?; readonly textures: { [key: string]: Texture; }; readonly collections: { [key: string]: Collection; }; readonly bumpers: { [key: string]: Bumper; }; readonly flippers: { [key: string]: Flipper; }; readonly flashers: { [key: string]: Flasher; }; readonly gates: { [key: string]: Gate; }; readonly hitTargets: { [key: string]: HitTarget; }; readonly kickers: { [key: string]: Kicker; }; readonly lights: { [key: string]: Light; }; readonly plungers: { [key: string]: Plunger; }; readonly primitives: { [key: string]: Primitive; }; readonly ramps: { [key: string]: Ramp; }; readonly rubbers: { [key: string]: Rubber; }; readonly spinners: { [key: string]: Spinner; }; readonly surfaces: { [key: string]: Surface; }; readonly textboxes: { [key: string]: Textbox; }; readonly timers: { [key: string]: Timer; }; readonly triggers: { [key: string]: Trigger; }; readonly decals: { [key: string]: Decal; }; readonly lightSeqs: { [key: string]: LightSeq; }; readonly dispReels: { [key: string]: DispReel; }; private readonly meshGenerator?; private readonly hitGenerator?; private readonly loader; static playfieldThickness: number; static load(reader: IBinaryReader, opts?: TableLoadOptions): Promise; constructor(loader: TableLoader, loadedTable: LoadedTable); getName(): string; getTexture(name?: string): Texture | undefined; getMaterial(name?: string): Material | undefined; getApi(): TableApi; getState(): TableState; getUpdater(): TableUpdater; getEventNames(): string[]; setupPlayer(player: Player, table: Table): void; getBoundingBox(): FRect3D; getPlayables(): IPlayable[]; getMovables(): IMovable[]; getRenderables(): Array>; getAnimatables(): IAnimatable[]; getScriptables(): Array>; getHittables(): IHittable[]; getHitShapes(): HitObject[]; generatePlayfieldHit(): HitPlane; generateGlassHit(): HitPlane; getElementApis(): { [key: string]: any; }; getElementApiName(vbsName: string): string; getElements(): { [key: string]: IScriptable; }; getScaleZ(): number; getDetailLevel(): number; getGlobalDifficulty(): number; getTableHeight(): number; getDimensions(): { width: number; height: number; }; getPlayfieldMap(): string; getSurfaceHeight(surface: string | undefined, x: number, y: number): number; streamStorage(name: string, streamer: (stg: Storage) => Promise): Promise; getTableScript(): string; isVisible(): boolean; getMeshes(table: Table, renderApi: IRenderApi, opts: TableExportOptions): Meshes; /** * Generates the top-most node for the render engine that contains the entire table. * * @param renderApi Render API * @param opts Which elements to generate */ generateTableNode(renderApi: IRenderApi, opts?: TableExportOptions): Promise; prepareToPlay(): void; runTableScript(player: Player, scope?: {}): void; broadcastInit(): void; fireVoidEvent(event: Event): this; setupCollections(): void; getItems(): Array>; } export interface TableLoadOptions { /** * If set, don't parse game items but only game data (faster). */ tableDataOnly?: boolean; /** * If set, ignore game storage and only parse table info. */ tableInfoOnly?: boolean; /** * If set, also parse items like timers, i.e. non-visible items. */ loadInvisibleItems?: boolean; /** * If set, table script is read */ loadTableScript?: boolean; /** * If set, skips reading primitive mesh data. */ skipMeshes?: boolean; } export interface TableGenerateOptions { exportPlayfield?: boolean; exportPrimitives?: boolean; exportRubbers?: boolean; exportSurfaces?: boolean; exportFlippers?: boolean; exportBumpers?: boolean; exportRamps?: boolean; exportLightBulbs?: boolean; exportPlayfieldLights?: boolean; exportLightBulbLights?: boolean; exportHitTargets?: boolean; exportGates?: boolean; exportKickers?: boolean; exportTriggers?: boolean; exportSpinners?: boolean; exportPlungers?: boolean; gltfOptions?: TableGenerateGltfOptions; } export interface TableGenerateGltfOptions { binary?: boolean; optimizeImages?: boolean; trs?: boolean; onlyVisible?: boolean; truncateDrawRange?: boolean; embedImages?: boolean; animations?: any[]; forceIndices?: boolean; forcePowerOfTwoTextures?: boolean; compressVertices?: boolean; versionString?: string; dracoOptions?: { compressionLevel?: number; quantizePosition?: number; quantizeNormal?: number; quantizeTexcoord?: number; quantizeColor?: number; quantizeSkin?: number; unifiedQuantization?: boolean; }; }