2024-10-24 09:32:31 +00:00
|
|
|
import type { Hex } from "./hexgrid";
|
|
|
|
|
2024-10-24 14:24:39 +00:00
|
|
|
|
|
|
|
export type GameTab = 'village' | 'resources';
|
|
|
|
|
|
|
|
|
2024-10-25 17:03:32 +00:00
|
|
|
export interface CostType {
|
2024-10-21 15:35:32 +00:00
|
|
|
wood: number;
|
|
|
|
stone: number;
|
|
|
|
iron: number;
|
|
|
|
food: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-25 17:03:32 +00:00
|
|
|
export type ProductionType = CostType;
|
2024-10-22 15:15:35 +00:00
|
|
|
|
|
|
|
|
2024-10-21 15:35:32 +00:00
|
|
|
export interface BuildingSource {
|
|
|
|
name: string;
|
2024-10-24 14:24:39 +00:00
|
|
|
type: string;
|
|
|
|
autoBuilt?: boolean;
|
2024-10-25 17:03:32 +00:00
|
|
|
cost: (level: number) => CostType;
|
2024-10-21 15:35:32 +00:00
|
|
|
behavior: {
|
|
|
|
production?: Function;
|
2024-10-22 15:15:35 +00:00
|
|
|
storage?: Function;
|
2024-10-25 17:03:32 +00:00
|
|
|
units?: {
|
|
|
|
type: string;
|
|
|
|
recruitmentTime: Function;
|
|
|
|
};
|
2024-10-21 15:35:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-25 17:03:32 +00:00
|
|
|
export interface BuildingType extends BuildingSource {
|
2024-10-21 15:35:32 +00:00
|
|
|
id: number;
|
2024-10-23 08:14:19 +00:00
|
|
|
level: number;
|
2024-10-24 09:32:31 +00:00
|
|
|
tile: Hex;
|
2024-10-25 17:03:32 +00:00
|
|
|
state: {
|
|
|
|
recruitment?: {
|
|
|
|
count: number;
|
|
|
|
elapsedTime: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface UnitType {
|
|
|
|
type: string;
|
|
|
|
name: string;
|
|
|
|
cost: CostType;
|
|
|
|
behavior: {
|
|
|
|
foodIntakePerMinute: number;
|
|
|
|
culturePerMinute?: number;
|
|
|
|
}
|
2024-10-21 15:35:32 +00:00
|
|
|
}
|