логика выделена в отдельный набор классов

This commit is contained in:
azykov@mail.ru
2026-09-05 10:24:24 +03:00
parent 2f57140899
commit 10041d9593
16 changed files with 1294 additions and 469 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
import type { Inventory, RabbitState, ResourceDrop, ResourceNode, Vec2 } from './types';
import type { Inventory, RabbitData, ResourceDropData, ResourceNodeData, Vec2 } from './types';
import type { UpgradeId } from './upgrades';
const STORAGE_KEY = 'forest-save-v1';
@@ -10,10 +10,10 @@ export interface SaveData {
/** World state (character/nodes/drops) is optional so older saves without it still load fine —
* progress is restored either way, just with a freshly spawned world. */
character?: Vec2;
nodes?: ResourceNode[];
resourceDrops?: ResourceDrop[];
nodes?: ResourceNodeData[];
resourceDrops?: ResourceDropData[];
/** Absent on saves from before rabbits existed, which get a freshly spawned batch instead. */
rabbits?: RabbitState[];
rabbits?: RabbitData[];
/** Absent on older saves, which are treated as day 1. */
day?: number;
/** In-game clock hour (0-24). Absent on older saves, which are treated as noon. */