2025-07-21 22:14:06 +08:00
|
|
|
export interface Dialog {
|
|
|
|
|
isPlayer: boolean;
|
|
|
|
|
content: string;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-16 16:55:39 +08:00
|
|
|
export class DiaLogData {
|
2025-09-16 19:03:00 +08:00
|
|
|
public playerDialog: Dialog = null;
|
|
|
|
|
public aiDialogs: Dialog[] = [];
|
2025-07-21 22:14:06 +08:00
|
|
|
|
|
|
|
|
public cleanDialog() {
|
2025-09-16 19:03:00 +08:00
|
|
|
this.playerDialog = null;
|
|
|
|
|
this.aiDialogs = [];
|
2025-07-21 22:14:06 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-16 16:55:39 +08:00
|
|
|
public pushDialog(
|
|
|
|
|
isPlayer: boolean,
|
|
|
|
|
str: string,
|
|
|
|
|
isLoading: boolean = false
|
|
|
|
|
) {
|
2025-09-16 19:03:00 +08:00
|
|
|
if (isPlayer) {
|
|
|
|
|
this.playerDialog = { isPlayer: true, content: str };
|
|
|
|
|
} else {
|
|
|
|
|
this.aiDialogs.push({ isPlayer: false, content: str });
|
|
|
|
|
}
|
2025-07-21 22:14:06 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-16 19:03:00 +08:00
|
|
|
public GetPlayerDialog() {
|
|
|
|
|
return this.playerDialog;
|
|
|
|
|
}
|
|
|
|
|
public GetAIDialog() {
|
|
|
|
|
return this.aiDialogs;
|
2025-07-21 22:14:06 +08:00
|
|
|
}
|
|
|
|
|
}
|