-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
68 lines (61 loc) · 1.67 KB
/
types.ts
File metadata and controls
68 lines (61 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export type Language = 'zh' | 'en';
export enum GamePhase {
POLITICAL = "POLITICAL_MANEUVERING",
SIEGE = "MILITARY_SIEGE",
ESCAPE = "ESCAPE_AND_EVASION",
CAPTURED = "CAPTURED_INTERROGATION",
ENDING = "ENDING_SEQUENCE",
ENDED = "GAME_OVER"
}
export type AIProvider = 'gemini' | 'volcano' | 'siliconflow' | 'local';
export interface AIConfig {
provider: AIProvider;
apiKey?: string;
endpointId?: string; // For Volcano Engine (Model Endpoint ID)
modelId?: string; // For SiliconFlow or others
language: Language;
}
export interface PlayerStats {
publicSupport: number; // 0-100
militaryLoyalty: number; // 0-100
securityLevel: number; // 0-100: Personal safety
panic: number; // 0-100: Affects hallucinations/clarity
}
export interface StoryOption {
id: string;
text: string;
type: 'aggressive' | 'diplomatic' | 'stealth' | 'desperate';
risk: 'low' | 'medium' | 'high' | 'extreme';
// Optional: Used for local mode pre-calculated outcomes
outcome?: {
narrative: string;
statsDelta: Partial<PlayerStats>;
isGameOver?: boolean;
endingType?: 'victory' | 'death' | 'prison' | 'exile';
};
}
export interface TurnData {
narrative: string;
newsTicker: string;
location: string;
time: string;
imageUrl?: string;
options: StoryOption[];
statsDelta: Partial<PlayerStats>;
isGameOver: boolean;
endingType?: 'victory' | 'death' | 'prison' | 'exile';
}
export interface GameState {
turnNumber: number;
phase: GamePhase;
stats: PlayerStats;
history: {
turn: number;
narrativeSummary: string;
choiceMade: string;
}[];
currentTurnData: TurnData | null;
isLoading: boolean;
error: string | null;
language: Language;
}