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