game-village-politics-frontend/app/composables/useVillageSelection.ts

14 lines
416 B
TypeScript

import type { BuildingType } from '~/types/game'
/**
* The empty plot picked in the fullscreen village: a type that doesn't stand yet, whose
* build card opens on the overview. Buildings open their own screens instead.
*/
export function useVillageSelection() {
const plot = useState<BuildingType | null>('village.plot', () => null)
const clear = () => {
plot.value = null
}
return { plot, clear }
}