<script setup lang="ts">
import Field from '@/components/game/Field.vue'
import { ref } from 'vue'
import type { FieldSize } from '@/scripts/interfaces/FieldSize.ts'
import LocalGame from '@/scripts/logic/localMode/LocalGame.ts'

const gameFieldSize: FieldSize = {
  x: 7,
  y: 6,
}

const game = ref(new LocalGame(gameFieldSize))
const currentSelection = ref(null)
</script>

<template>
  <Field
    v-model:current-selection-index="currentSelection"
    :gameState="game.field"
    @clickOnGameField="game.place(currentSelection)"
  ></Field>
</template>

<style scoped></style>