import { Text } from '../../text/3d/text'; import { State } from '../../state/3d/state'; import { System } from '../../system/3d/system'; import { UI } from '../../ui/3d/ui'; import { World } from '../../world/3d/world'; import { GameBase } from '../game.base'; import { GameConfig } from './game.config'; import { ClassType } from '../../aura.types'; /** * Concrete 3D Game, setting out the 3D-specific properties and behavior for the operation of 3D Games */ export declare class Game extends GameBase { /** Concrete 3D World */ readonly world: World; /** Concrete 3D Font */ readonly text: Text; /** Concrete 3D UI */ readonly ui: UI; /** Concrete mapping of 3D States */ protected readonly states: Map; /** Concrete reference to the current 3D State */ protected currentState: State | undefined; /** Concrete mapping of 3D Systems */ protected readonly systems: Map; /** * Constructor. Pass an optional 3D GameConfig to the parent class and initialise all 3D-specific aspects of the Game * * @param config the optional 3D GameConfig */ constructor(config?: GameConfig); /** * Add a single 3D State to the Game * * @param state the 3D State to add */ addState(state: State): void; /** * Add a list of 3D States to the Game * * @param state the list of 3D States to add */ addStates(...states: Array): void; /** * Add a single 3D System to the Game * * Throws an error if the system already exists so as to prevent accidental replacement * * @param system the 3D System to add */ addSystem(system: ClassType): void; /** * Add a list of 3D Systems to the Game * * @param systems the list of 3D Systems to add * @param override whether or not to allow the provided systems to override existing instances */ addSystems(...systems: Array>): void; /** * Retrieve a System from the Game * * Throws an error if the System is not found to allow type safety + simplistic no-questions consumer calls * * @typeparam T the type of the System to retrieve * * @param name the name of the System to retrieve * * @returns the retrieved System */ getSystem(name: string): T; /** * Concrete 3D State initialization routine, passing the type-correct 3D Game to the State's lifecycle method */ protected initState(): void; /** * Concrete 3D State end routine, passing the type-correct 3D Game to the State's lifecycle method */ protected endState(): void; /** * Concrete frame update routine, passing the type-correct 3D Game to the State's lifecycle method * * Just updates all 3D Systems and the current 3D State */ protected update(): void; }