knowyt/client/src/composables/engine/game.ts
2022-08-28 22:31:49 +02:00

37 lines
934 B
TypeScript

import { useUserinfoStore } from "@/stores/UserinfoStore"
export async function collectQuotes(): Promise<void> {
const userInfoStore = useUserinfoStore()
await this.callApi('/api/collectQuotes', {
g: userInfoStore.gameId,
})
}
export async function startGame(): Promise<void> {
const userInfoStore = useUserinfoStore()
await this.callApi('/api/startGame', {
g: userInfoStore.gameId,
})
}
export async function continueGame(): Promise<void> {
const userInfoStore = useUserinfoStore()
await this.callApi('/api/continueGame', {
g: userInfoStore.gameId,
})
}
export async function resetGame(): Promise<void> {
const userInfoStore = useUserinfoStore()
await this.callApi('/api/resetGame', {
g: userInfoStore.gameId,
})
}
export async function finishGame(): Promise<void> {
const userInfoStore = useUserinfoStore()
await this.callApi('/api/finishGame', {
g: userInfoStore.gameId,
})
}