create StateManager from file
This commit is contained in:
parent
58b8bbc27b
commit
2837461add
@ -10,6 +10,7 @@ import { openingScene } from "./openingscene.ts";
|
|||||||
import { generateName } from "./namegen.ts";
|
import { generateName } from "./namegen.ts";
|
||||||
import { photogenicThralls } from "./thralls.ts";
|
import { photogenicThralls } from "./thralls.ts";
|
||||||
import { choose } from "./utils.ts";
|
import { choose } from "./utils.ts";
|
||||||
|
import { SaveFileV1 } from "./saveformat.ts";
|
||||||
|
|
||||||
const N_TURNS: number = 9;
|
const N_TURNS: number = 9;
|
||||||
|
|
||||||
@ -17,9 +18,9 @@ export class StateManager {
|
|||||||
#turn: number;
|
#turn: number;
|
||||||
#revision: number;
|
#revision: number;
|
||||||
|
|
||||||
constructor() {
|
constructor(file?:SaveFileV1) {
|
||||||
this.#turn = 1;
|
this.#turn = file?.turn ?? 1;
|
||||||
this.#revision = 1;
|
this.#revision = file?.revision ?? 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTurn(): number {
|
getTurn(): number {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user