Initial commit

This commit is contained in:
2025-04-01 08:37:41 +02:00
commit 39c1b6ff0a
59 changed files with 14076 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
/**
* Interfaces for the game engine
*/
import { WorldModel, GameState } from './world-model';
import { ActionResponse, NarrativeResponse } from './llm';
export interface ActionResult {
success: boolean;
message: string;
stateChanged: boolean;
newState?: GameState;
}
export interface GameEngine {
loadWorld(worldModelPath: string): Promise<void>;
getCurrentState(): GameState;
getWorldModel(): WorldModel;
processAction(action: ActionResponse): ActionResult;
saveGame(filename: string): Promise<void>;
loadGame(filename: string): Promise<void>;
getAvailableActions(): string[];
getVisibleObjects(): string[];
getVisibleCharacters(): string[];
getCurrentRoomDescription(): string;
start(): Promise<string>;
end(): void;
}
export interface GameSession {
engine: GameEngine;
history: {
playerInput: string;
actionResponse: ActionResponse;
actionResult: ActionResult;
narrativeResponse: NarrativeResponse;
}[];
startTime: Date;
lastInteractionTime: Date;
}
export interface ActionHandler {
execute(gameState: GameState, worldModel: WorldModel, action: ActionResponse): ActionResult;
}