initial commit

This commit is contained in:
azykov@mail.ru
2026-02-13 14:31:24 +03:00
commit 03d4948f64
47 changed files with 6326 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { makeGame, ResourceGenerator, ResourceSet } from "@idle-economy/engine";
import { makeAutoObservable } from "mobx";
export class Root {
private readonly game = makeGame();
public resources: ResourceSet = new ResourceSet();
public generators: ResourceGenerator[] = [];
constructor() {
this.copyGame();
makeAutoObservable(this);
}
public tick(deltaTime: number): void {
Array.from(this.game.tick(deltaTime));
this.copyGame();
}
private copyGame(): void {
this.resources = this.game.resources;
this.generators = this.game.generators;
}
}
export const root = new Root();