added game id and password

This commit is contained in:
2024-11-09 13:28:06 +01:00
parent bf291728b3
commit 632319d622

View File

@@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
export const useGameStore = defineStore('game', {
state: (): GameState => ({
id: 0x000000,
board: [
{ row: 'A', fields: [0, 0, 0] },
{ row: 'B', fields: [0, 0, 0] },
@@ -33,6 +34,8 @@ export const useGameStore = defineStore('game', {
}),
actions: {
initGame() {
this.id = 0x000000
this.password = undefined
this.board = [
{ row: 'A', fields: [0, 0, 0] },
{ row: 'B', fields: [0, 0, 0] },
@@ -68,6 +71,8 @@ export const useGameStore = defineStore('game', {
})
interface GameState {
id: number
password?: string
board: Array<{
row: 'A' | 'B' | 'C'
fields: Array<number>