bourgade/src/village.ts

39 lines
788 B
TypeScript
Raw Normal View History

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