This commit is contained in:
2026-06-07 13:50:05 +08:00
commit aeb6dc46a4
28 changed files with 4458 additions and 0 deletions

27
src/stores/gameStore.ts Normal file
View File

@@ -0,0 +1,27 @@
import { defineStore } from 'pinia'
import { ref, shallowRef } from 'vue'
import type { SceneNode, Choice } from '@engine/types'
export const useGameStore = defineStore('game', () => {
const currentScene = shallowRef<SceneNode | null>(null)
const choices = ref<Choice[]>([])
const gameEnded = ref(false)
function setScene(scene: SceneNode) {
currentScene.value = scene
}
function setChoices(list: Choice[]) {
choices.value = list
}
function clearChoices() {
choices.value = []
}
function setGameEnded(val: boolean) {
gameEnded.value = val
}
return { currentScene, choices, gameEnded, setScene, setChoices, clearChoices, setGameEnded }
})