update chat exp

This commit is contained in:
2025-09-16 19:03:00 +08:00
parent 141c6a5909
commit 4e00f2a382
6 changed files with 1104 additions and 874 deletions
+14 -11
View File
@@ -1,14 +1,15 @@
export interface Dialog {
isPlayer: boolean;
content: string;
isLoading?: boolean;
}
export class DiaLogData {
public Dialogs: Dialog[] = [];
public playerDialog: Dialog = null;
public aiDialogs: Dialog[] = [];
public cleanDialog() {
this.Dialogs = [];
this.playerDialog = null;
this.aiDialogs = [];
}
public pushDialog(
@@ -16,15 +17,17 @@ export class DiaLogData {
str: string,
isLoading: boolean = false
) {
if (!this.Dialogs) this.Dialogs = [];
this.Dialogs.push({
isPlayer: isPlayer,
content: str,
isLoading: isLoading,
});
if (isPlayer) {
this.playerDialog = { isPlayer: true, content: str };
} else {
this.aiDialogs.push({ isPlayer: false, content: str });
}
}
public GetDialogs() {
return this.Dialogs;
public GetPlayerDialog() {
return this.playerDialog;
}
public GetAIDialog() {
return this.aiDialogs;
}
}