1
0
forked from noxious/client
This commit is contained in:
2025-01-07 22:20:46 +01:00
parent c2db9b5469
commit 574777da80
19 changed files with 385 additions and 416 deletions

View File

@ -4,7 +4,7 @@ import { defineStore } from 'pinia'
export const useMapStore = defineStore('map', {
state: () => {
return {
map: null as Map | null,
mapId: '',
characters: [] as MapCharacter[],
characterLoaded: false
}
@ -16,13 +16,10 @@ export const useMapStore = defineStore('map', {
getCharacterCount: (state) => {
return state.characters.length
},
isMapSet: (state) => {
return state.map !== null
}
},
actions: {
setMap(map: Map | null) {
this.map = map
setMapId(mapId: UUID) {
this.mapId = mapId
},
setCharacters(characters: MapCharacter[]) {
this.characters = characters
@ -50,7 +47,7 @@ export const useMapStore = defineStore('map', {
}
},
reset() {
this.map = null
this.mapId = ''
this.characters = []
this.characterLoaded = false
}