78 lines
2.0 KiB
TypeScript
78 lines
2.0 KiB
TypeScript
/**
|
|
* Core Game Engine
|
|
* Manages game state and processes actions
|
|
*/
|
|
import { GameEngine, ActionResult } from '../interfaces/engine';
|
|
import { WorldModel, GameState } from '../interfaces/world-model';
|
|
import { ActionResponse } from '../interfaces/llm';
|
|
export declare class TextAdventureEngine implements GameEngine {
|
|
private worldModel;
|
|
private gameState;
|
|
private actionHandlers;
|
|
constructor();
|
|
/**
|
|
* Load a world model from a file
|
|
*/
|
|
loadWorld(worldModelPath: string): Promise<void>;
|
|
/**
|
|
* Get the current game state
|
|
*/
|
|
getCurrentState(): GameState;
|
|
/**
|
|
* Get the world model
|
|
*/
|
|
getWorldModel(): WorldModel;
|
|
/**
|
|
* Process an action from the player
|
|
*/
|
|
processAction(action: ActionResponse): ActionResult;
|
|
/**
|
|
* Save the current game state to a file
|
|
*/
|
|
saveGame(filename: string): Promise<void>;
|
|
/**
|
|
* Load a game state from a save file
|
|
*/
|
|
loadGame(filename: string): Promise<void>;
|
|
/**
|
|
* Get a list of available actions in the current context
|
|
*/
|
|
getAvailableActions(): string[];
|
|
/**
|
|
* Get a list of visible objects in the current room
|
|
*/
|
|
getVisibleObjects(): string[];
|
|
/**
|
|
* Get a list of visible characters in the current room
|
|
*/
|
|
getVisibleCharacters(): string[];
|
|
/**
|
|
* Get the description of the current room
|
|
*/
|
|
getCurrentRoomDescription(): string;
|
|
/**
|
|
* Start the game and return the introduction text
|
|
*/
|
|
start(): Promise<string>;
|
|
/**
|
|
* End the game (cleanup resources if needed)
|
|
*/
|
|
end(): void;
|
|
/**
|
|
* Get the current room object
|
|
*/
|
|
private getCurrentRoom;
|
|
/**
|
|
* Register default action handlers
|
|
*/
|
|
private registerDefaultActionHandlers;
|
|
/**
|
|
* Find an object by name in a list of object IDs
|
|
*/
|
|
private findObjectByName;
|
|
/**
|
|
* Find a character by name in a list of character IDs
|
|
*/
|
|
private findCharacterByName;
|
|
}
|