game-village-politics-frontend/app/components/map/Villages.vue

16 lines
583 B
Vue

<script setup lang="ts">
defineProps<{
/** Villages to draw, back to front (row by row): the look to <use> and the relation colour. */
villages: { id: number; x: number; y: number; look: string; colour: string }[]
/** Field size in px. */
field: number
}>()
</script>
<!-- Each village one <use> of its look (MapVillageDefs), edged and flagged in the relation colour. -->
<template>
<g pointer-events="none">
<use v-for="v in villages" :key="v.id" :href="v.look" :x="v.x * field" :y="v.y * field" :width="field" :height="field" :color="v.colour" />
</g>
</template>