34 lines
639 B
TypeScript
34 lines
639 B
TypeScript
export interface Dialog {
|
|
isPlayer: boolean;
|
|
content: string;
|
|
}
|
|
|
|
export class DiaLogData {
|
|
public playerDialog: Dialog = null;
|
|
public aiDialogs: Dialog[] = [];
|
|
|
|
public cleanDialog() {
|
|
this.playerDialog = null;
|
|
this.aiDialogs = [];
|
|
}
|
|
|
|
public pushDialog(
|
|
isPlayer: boolean,
|
|
str: string,
|
|
isLoading: boolean = false
|
|
) {
|
|
if (isPlayer) {
|
|
this.playerDialog = { isPlayer: true, content: str };
|
|
} else {
|
|
this.aiDialogs.push({ isPlayer: false, content: str });
|
|
}
|
|
}
|
|
|
|
public GetPlayerDialog() {
|
|
return this.playerDialog;
|
|
}
|
|
public GetAIDialog() {
|
|
return this.aiDialogs;
|
|
}
|
|
}
|