2024-10-24 11:32:31 +02:00
|
|
|
import type { Hex } from "./hexgrid";
|
|
|
|
|
2024-10-24 16:24:39 +02:00
|
|
|
|
2024-11-07 11:18:49 +01:00
|
|
|
export type GameTab = 'village' | 'resources' | 'world';
|
2024-10-24 16:24:39 +02:00
|
|
|
|
|
|
|
|
2024-10-25 19:03:32 +02:00
|
|
|
export interface CostType {
|
2024-10-21 17:35:32 +02:00
|
|
|
wood: number;
|
|
|
|
stone: number;
|
|
|
|
iron: number;
|
|
|
|
food: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-25 19:03:32 +02:00
|
|
|
export type ProductionType = CostType;
|
2024-10-22 17:15:35 +02:00
|
|
|
|
|
|
|
|
2024-11-04 18:10:26 +01:00
|
|
|
export interface ResourcesType extends CostType {
|
|
|
|
culture: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-21 17:35:32 +02:00
|
|
|
export interface BuildingSource {
|
|
|
|
name: string;
|
2024-10-24 16:24:39 +02:00
|
|
|
type: string;
|
|
|
|
autoBuilt?: boolean;
|
2024-10-25 19:03:32 +02:00
|
|
|
cost: (level: number) => CostType;
|
2024-10-21 17:35:32 +02:00
|
|
|
behavior: {
|
|
|
|
production?: Function;
|
2024-10-22 17:15:35 +02:00
|
|
|
storage?: Function;
|
2024-10-25 19:03:32 +02:00
|
|
|
units?: {
|
|
|
|
type: string;
|
|
|
|
recruitmentTime: Function;
|
|
|
|
};
|
2024-10-21 17:35:32 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-25 19:03:32 +02:00
|
|
|
export interface BuildingType extends BuildingSource {
|
2024-10-21 17:35:32 +02:00
|
|
|
id: number;
|
2024-10-23 10:14:19 +02:00
|
|
|
level: number;
|
2024-10-24 11:32:31 +02:00
|
|
|
tile: Hex;
|
2024-10-25 19:03:32 +02:00
|
|
|
state: {
|
2024-11-05 12:42:39 +01:00
|
|
|
upgrade: {
|
|
|
|
isUpgrading: boolean,
|
|
|
|
remainingTime: number;
|
|
|
|
}
|
2024-10-25 19:03:32 +02:00
|
|
|
recruitment?: {
|
|
|
|
count: number;
|
|
|
|
elapsedTime: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface UnitType {
|
|
|
|
type: string;
|
|
|
|
name: string;
|
|
|
|
cost: CostType;
|
|
|
|
behavior: {
|
2024-11-07 15:14:24 +01:00
|
|
|
caryingCapacity: number;
|
2024-10-25 19:03:32 +02:00
|
|
|
foodIntakePerMinute: number;
|
|
|
|
culturePerMinute?: number;
|
|
|
|
}
|
2024-10-21 17:35:32 +02:00
|
|
|
}
|
2024-11-07 11:18:49 +01:00
|
|
|
|
|
|
|
|
2024-11-07 14:20:34 +01:00
|
|
|
export interface MissionType {
|
|
|
|
type: string;
|
|
|
|
unitType: string;
|
|
|
|
unitCount: number;
|
|
|
|
remainingTime: number;
|
|
|
|
}
|
|
|
|
|
2024-11-07 11:18:49 +01:00
|
|
|
interface BaseRegionType {
|
|
|
|
distance: number;
|
|
|
|
state: {
|
2024-11-07 14:20:34 +01:00
|
|
|
index: number;
|
|
|
|
mission?: MissionType;
|
2024-11-07 11:18:49 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface OasisType extends BaseRegionType {
|
|
|
|
type: 'oasis';
|
|
|
|
resource: keyof CostType;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface BourgadeType extends BaseRegionType {
|
|
|
|
type: 'bourgade';
|
|
|
|
distance: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export type RegionType = OasisType | BourgadeType;
|