update chat exp
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user