2024-10-21 15:35:32 +00:00
|
|
|
import { writable } from "svelte/store";
|
2024-10-23 08:36:03 +00:00
|
|
|
|
2024-10-21 15:35:32 +00:00
|
|
|
import buildings from "./buildings";
|
2024-10-23 08:14:19 +00:00
|
|
|
import { createBuilding } from "./create";
|
2024-10-21 15:35:32 +00:00
|
|
|
import type { Building } from "./types";
|
|
|
|
|
|
|
|
|
|
|
|
export interface VillageState {
|
|
|
|
buildings: Building[];
|
|
|
|
resources: {
|
|
|
|
wood: number;
|
|
|
|
stone: number;
|
|
|
|
iron: number;
|
|
|
|
food: number;
|
|
|
|
culture: number;
|
2024-10-22 15:15:35 +00:00
|
|
|
};
|
2024-10-21 15:35:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const village = writable<VillageState>({
|
|
|
|
buildings: [
|
2024-10-23 08:14:19 +00:00
|
|
|
createBuilding(buildings.townhall),
|
2024-10-23 08:36:03 +00:00
|
|
|
createBuilding(buildings.woodcutter),
|
|
|
|
createBuilding(buildings.pit),
|
|
|
|
createBuilding(buildings.mine),
|
|
|
|
createBuilding(buildings.field),
|
2024-10-21 15:35:32 +00:00
|
|
|
],
|
|
|
|
resources: {
|
2024-10-23 08:36:03 +00:00
|
|
|
wood: 60,
|
|
|
|
stone: 60,
|
|
|
|
iron: 60,
|
|
|
|
food: 50,
|
2024-10-21 15:35:32 +00:00
|
|
|
culture: 0,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default village;
|