thomas-anderson-lib
Version:
A text adventure game library based on Thomas Anderson from The Matrix. Create your own Matrix-inspired text adventures with this easy-to-use library.
20 lines (19 loc) • 535 B
TypeScript
import { Room, Item, GameResponse } from './types';
export declare class GameEngine {
private rooms;
private state;
constructor(initialRoom: string);
addRoom(room: Room): void;
getCurrentRoom(): Room | undefined;
getInventory(): Item[];
getScore(): number;
isGameOver(): boolean;
private updateScore;
private moveToRoom;
private handleGo;
private handleGive;
private handleTake;
private handleLook;
private handleInventory;
processCommand(input: string): GameResponse;
}