65 lines
1.5 KiB
TypeScript
65 lines
1.5 KiB
TypeScript
/**
|
|
* Command-line interface for running the interactive fiction game
|
|
*/
|
|
export declare class GameRunner {
|
|
private engine;
|
|
private llmProvider;
|
|
private rl;
|
|
private gameContext;
|
|
private gameHistory;
|
|
private suggestedCommands;
|
|
constructor();
|
|
/**
|
|
* Initialize the game
|
|
*/
|
|
initialize(worldPath: string): Promise<void>;
|
|
/**
|
|
* Start the game in CLI mode
|
|
*/
|
|
start(): Promise<void>;
|
|
/**
|
|
* The main game loop for CLI mode
|
|
*/
|
|
private gameLoop;
|
|
/**
|
|
* Process a player command and return the narrative response
|
|
* Used by both CLI and web interfaces
|
|
*/
|
|
processCommand(input: string): Promise<string>;
|
|
/**
|
|
* End the game
|
|
*/
|
|
end(): void;
|
|
/**
|
|
* Update the game context with new narrative
|
|
*/
|
|
private updateGameContext;
|
|
/**
|
|
* Get the current game state
|
|
* Used by web interface
|
|
*/
|
|
getGameState(): {
|
|
world: import("../interfaces/world-model").WorldModel;
|
|
currentRoomId: string;
|
|
inventory: string[];
|
|
visitedRooms: string[];
|
|
flags: Record<string, boolean>;
|
|
counters: Record<string, number>;
|
|
};
|
|
/**
|
|
* Get the current room description
|
|
* Used by web interface
|
|
*/
|
|
getCurrentRoomDescription(): string;
|
|
/**
|
|
* Get suggested actions for the current game state
|
|
* Used by web interface
|
|
*/
|
|
getSuggestions(): string[];
|
|
/**
|
|
* Load a saved game state
|
|
* Used by web interface
|
|
*/
|
|
loadGameState(savedState: any): void;
|
|
}
|