UNPKG

asciitorium

Version:
34 lines (33 loc) 1.13 kB
import { type MapAsset, type LegendEntry } from './AssetManager.js'; import { State } from './State.js'; import type { Player } from '../components/MapView.js'; export interface GridMovementOptions { mapAsset: State<MapAsset | null>; player: State<Player>; } export declare class GridMovement { private mapState; private playerState; private previousPosition; constructor(options: GridMovementOptions); getPlayerState(): State<Player>; getPlayer(): Player; getMapState(): State<MapAsset | null>; getMapData(): string[]; getLegend(): Record<string, LegendEntry>; isReady(): boolean; getLegendEntry(char: string): LegendEntry | undefined; getCharAt(x: number, y: number): string | undefined; isSolidChar(char: string): boolean; isSolid(x: number, y: number): boolean; moveForward(): boolean; moveBackward(): boolean; turnLeft(): void; turnRight(): void; private getDirectionVector; private getOppositeDirection; private getNewDirection; private movePlayerBy; private checkAndPlayTileSound; private checkAndPlayExitSound; }