Rename Message.message to .content

This commit is contained in:
Tobias Berger 2021-10-02 19:37:09 +02:00
parent c034612a35
commit 619d5bbae1
2 changed files with 6 additions and 6 deletions

View file

@ -10,17 +10,17 @@ export enum MessageType {
export class Message { export class Message {
static even = true; static even = true;
isEven: boolean; isEven: boolean;
message: string; content: string;
type: MessageType; type: MessageType;
constructor(message: string, type: MessageType = MessageType.message) { constructor(message: string, type: MessageType = MessageType.message) {
this.message = message; this.content = message;
this.isEven = Message.even; this.isEven = Message.even;
this.type = type; this.type = type;
Message.even = !Message.even; Message.even = !Message.even;
} }
toString(): string { toString(): string {
return this.message; return this.content;
} }
} }

View file

@ -10,7 +10,7 @@ type Version0Save = typeof __EMPTY_OBJECT;
type Version1Save = Version0Save & { type Version1Save = Version0Save & {
version: 1; version: 1;
messages: { messages: {
message: string; content: string;
type: MessageType; type: MessageType;
}[]; }[];
selectedTab: keyof typeof TabHandler["AllTabs"]; selectedTab: keyof typeof TabHandler["AllTabs"];
@ -72,7 +72,7 @@ export class SaveHandler extends StaticClass {
settings: saveSettings, settings: saveSettings,
messages: messages.map((message) => { messages: messages.map((message) => {
return { return {
message: message.message, content: message.content,
type: message.type, type: message.type,
}; };
}), }),
@ -120,7 +120,7 @@ export class SaveHandler extends StaticClass {
game.Log.reset(); game.Log.reset();
fullSave.messages.forEach((message) => { fullSave.messages.forEach((message) => {
game.Log.addMessage(message.message, message.type); game.Log.addMessage(message.content, message.type);
}); });
game.TabHandler.currentTab = game.TabHandler.AllTabs[fullSave.selectedTab]; game.TabHandler.currentTab = game.TabHandler.AllTabs[fullSave.selectedTab];