import { Font2D } from '../../font/2d'; import { State2D } from '../../state/2d'; import { System2D } from '../../system/2d'; import { UI2D } from '../../ui/2d'; import { World2D } from '../../world/2d'; import { Game } from '../game'; import { Game2DConfig } from './game.2d.config'; /** * Concrete Game2D object, setting out the 2D-specific properties and runtime behaviour of 2D Aura Games * * Implements and type-narrows the abstract elements of the parent class Game so as to produce consumer type-safety on things like * Game structure management and State lifecycle methods */ export declare class Game2D extends Game { /** Concrete 2D World */ readonly world: World2D; /** Concrete 2D Font */ readonly font: Font2D; /** Concrete 2D UI */ readonly ui: UI2D; /** Concrete mapping of 2D States */ protected readonly states: Map; /** Concrete reference to the current 2D State */ protected currentState: State2D | undefined; /** Concrete mapping of 2D Systems */ protected readonly systems: Map; /** * Constructor. Take an optional GameConfig2D, pass it up to the parent class, and then initialise all 2D-specific aspects of the Game * * @param config the optional GameConfig2D */ constructor(config?: Game2DConfig); /** * Concrete single State2D addition routine, narrowing the generic type to ensure the correct configuration of a Game2D * * @param state the State2D to add */ addState(state: State2D): void; /** * Concrete multi State2D addition routine, narrowing the generic type to ensure the correct configuration of a Game2D * * @param states the list of State2Ds to add */ addStates(...states: Array): void; /** * Concrete State init routine, ensuring that the State2D lifecycle method init() receives the type-correct Game2D */ initState(): void; /** * Concrete State end routine, ensuring that the State2D lifecycle method end() receives the type-correct Game2D */ endState(): void; /** * Concrete single System2D adition routine, narrowing the generic type to ensure the correct configuration of a Game2D * * @param system the System2D to add */ addSystem(system: System2D): void; /** * Concrete multi System2D addition routine, narrowing the generic type to ensure the correct configuration of a Game2D * * @param systems the list of System2Ds to add */ addSystems(...systems: Array): void; /** * Concrete frame update routine, ensuring that the System2D and State2D tick() lifecycle methods receive the type-correct Game2D * * Just updates all System2Ds and the current State2D */ protected update(): void; }