move recruitment logic from the adventurer view to the main save data

This commit is contained in:
2023-03-29 00:31:14 +02:00
parent 5b4278cf30
commit 0890efd1ec
5 changed files with 167 additions and 156 deletions
+10 -1
View File
@@ -9,13 +9,21 @@ export class GameData {
missives: { [key: string]: { [key: string]: Quest } };
lastQuestGot: { [key: string]: null | number };
lastRecruitAction: null | number;
currentlyForHireId: string|null;
constructor(guild: Guild, adventurers: { [key: string]: Adventurer }, missives: { [key: string]: { [key: string]: Quest } }, lastQuestGot: { [key: string]: null | number }, lastRecruitAction: null | number) {
constructor(
guild: Guild, adventurers: { [key: string]: Adventurer },
missives: { [key: string]: { [key: string]: Quest } },
lastQuestGot: { [key: string]: null | number },
lastRecruitAction: null | number,
currentlyForHireId: string|null = null
) {
this.guild = guild;
this.adventurers = adventurers;
this.missives = missives;
this.lastQuestGot = lastQuestGot;
this.lastRecruitAction = lastRecruitAction;
this.currentlyForHireId = currentlyForHireId;
}
}
@@ -33,6 +41,7 @@ export function saveGame(
missives: data.missives,
lastQuestGot: data.lastQuestGot,
lastRecruitAction: data.lastRecruitAction,
adventurerForHireId: data.currentlyForHireId,
}));
}