object move blocks

debug floaters
This commit is contained in:
azykov@mail.ru
2026-06-12 21:11:35 +03:00
parent 20a4edad5a
commit 209ff3f710
31 changed files with 527 additions and 53 deletions
+39
View File
@@ -0,0 +1,39 @@
import { makeAutoObservable } from "mobx";
class DebugLabelsStore {
public labels = new Map<string, Record<string, string>>();
constructor() {
makeAutoObservable(this);
}
public getAll(objectId: string): Record<string, string> {
return this.labels.get(objectId) ?? {};
}
public getOne(objectId: string, key: string): string | undefined {
return this.getAll(objectId)[key];
}
public setOne(objectId: string, key: string, text: string) {
if (!this.labels.has(objectId))
this.labels.set(objectId, {});
this.labels.get(objectId)![key] = text;
}
public deleteAll(objectId: string) {
this.labels.delete(objectId);
}
public deleteOne(objectId: string, key: string) {
if (this.labels.has(objectId)) {
delete (this.labels.get(objectId)![key]);
}
}
public clear() {
this.labels.clear();
}
}
export const debugLabelsStore = new DebugLabelsStore();
+4
View File
@@ -124,6 +124,10 @@ export class GameState {
if (this.isPaused)
return;
this.step(deltaTime);
}
public step(deltaTime: number = 1 / 60): void {
this.coroutines.tick(deltaTime);
this.time += deltaTime;