1
0
forked from noxious/client

Updated TS types

This commit is contained in:
Dennis Postma 2024-07-21 22:26:28 +02:00
parent 5140e205ad
commit 12cd7b667a
3 changed files with 20 additions and 8 deletions

View File

@ -23,7 +23,7 @@
{{ tag }}
</button>
</div>
<div class=" h-full overflow-auto">
<div class="h-full overflow-auto">
<div class="flex justify-between flex-wrap gap-2.5 items-center">
<div v-for="(object, index) in filteredObjects" :key="index" class="max-w-1/4 inline-block">
<img

View File

@ -61,6 +61,6 @@ export const useGameStore = defineStore('game', {
this.character = null
useCookies().remove('token')
},
}
}
})

View File

@ -16,10 +16,10 @@ export type Sprite = {
origin_x: number
origin_y: number
frameSpeed: number
frameWidth: number
frameHeight: number
isAnimated: boolean
isLooping: boolean
isPlayableCharacter: boolean
isEnemy: boolean
createdAt: Date
updatedAt: Date
}
@ -27,7 +27,7 @@ export type Sprite = {
export type Tile = {
id: string
name: string
tags: string[]
tags?: any
createdAt: Date
updatedAt: Date
}
@ -35,9 +35,13 @@ export type Tile = {
export type Object = {
id: string
name: string
tags: string[]
tags?: any
origin_x: number
origin_y: number
isAnimated: boolean
frameSpeed: number
frameWidth: number
frameHeight: number
createdAt: Date
updatedAt: Date
ZoneObject: ZoneObject[]
@ -93,7 +97,8 @@ export type Zone = {
name: string
width: number
height: number
tiles: any // Using 'any' for Json type, consider using a more specific type if possible
tiles: string[][]
pvp: boolean
zoneEventTiles: ZoneEventTile[]
zoneObjects: ZoneObject[]
characters: Character[]
@ -113,11 +118,18 @@ export type ZoneObject = {
position_y: number
}
export enum ZoneEventTileType {
BLOCK = 'BLOCK',
WARP = 'WARP',
NPC = 'NPC',
ITEM = 'ITEM'
}
export type ZoneEventTile = {
id: string
zoneId: number
zone: Zone
type: 'BLOCK' | 'WARP' | 'NPC' | 'ITEM'
type: ZoneEventTileType
position_x: number
position_y: number
}