Almost finalised refactoring

This commit is contained in:
2025-01-03 14:35:08 +01:00
parent 145143cdc5
commit 700bd57e67
29 changed files with 264 additions and 273 deletions

View File

@ -1,4 +1,4 @@
import type { Object, Tile, Map, MapEffect, PlacedMapObject } from '@/application/types'
import type { Map, MapEffect, MapObject, PlacedMapObject, Tile } from '@/application/types'
import { useGameStore } from '@/stores/gameStore'
import { defineStore } from 'pinia'
@ -19,11 +19,11 @@ export const useMapEditorStore = defineStore('mapEditor', {
eraserMode: 'tile',
mapList: [] as Map[],
tileList: [] as Tile[],
objectList: [] as Object[],
mapObjectList: [] as MapObject[],
selectedTile: '',
selectedObject: null as Object | null,
selectedObject: null as MapObject | null,
isTileListModalShown: false,
isObjectListModalShown: false,
isMapObjectListModalShown: false,
isMapListModalShown: false,
isCreateMapModalShown: false,
isSettingsModalShown: false,
@ -85,13 +85,13 @@ export const useMapEditorStore = defineStore('mapEditor', {
setTileList(tiles: Tile[]) {
this.tileList = tiles
},
setObjectList(objects: Object[]) {
this.objectList = objects
setMapObjectList(objects: MapObject[]) {
this.mapObjectList = objects
},
setSelectedTile(tile: string) {
this.selectedTile = tile
},
setSelectedObject(object: Object) {
setSelectedObject(object: MapObject) {
this.selectedObject = object
},
toggleSettingsModal() {
@ -118,13 +118,13 @@ export const useMapEditorStore = defineStore('mapEditor', {
if (resetMap) this.map = null
this.mapList = []
this.tileList = []
this.objectList = []
this.mapObjectList = []
this.tool = 'move'
this.drawMode = 'tile'
this.selectedTile = ''
this.selectedObject = null
this.isTileListModalShown = false
this.isObjectListModalShown = false
this.isMapObjectListModalShown = false
this.isSettingsModalShown = false
this.isMapListModalShown = false
this.isCreateMapModalShown = false