2024-10-24 11:32:31 +02:00
|
|
|
import { Hex } from "./hexgrid";
|
2024-10-23 10:14:19 +02:00
|
|
|
import type { Building, BuildingSource } from "./types";
|
|
|
|
|
|
|
|
|
|
|
|
let uid = 0;
|
|
|
|
|
|
|
|
|
|
|
|
export function createBuilding(building: BuildingSource): Building {
|
|
|
|
return {
|
|
|
|
...building,
|
|
|
|
id: uid++,
|
2024-10-24 11:32:31 +02:00
|
|
|
level: 1,
|
|
|
|
tile: new Hex(0, 0),
|
2024-10-23 10:14:19 +02:00
|
|
|
};
|
|
|
|
}
|