Worked on zone objects, tile tags and searching

This commit is contained in:
2024-07-04 02:07:45 +02:00
parent 2cfe80de11
commit 2fe6f8d9c0
22 changed files with 468 additions and 304 deletions

View File

@ -3,7 +3,33 @@ export type Notification = {
message: string
}
// User model
export type Asset = {
key: string
value: string
group: 'tiles' | 'objects' | 'sound' | 'music' | 'ui' | 'font' | 'other'
type: 'base64' | 'link'
}
export type Object = {
id: string
name: string
origin_x: number
origin_y: number
createdAt: Date
updatedAt: Date
ZoneObject: ZoneObject[]
}
export type Item = {
id: string
name: string
description: string
stackable: boolean
createdAt: Date
updatedAt: Date
characters: CharacterItem[]
}
export type User = {
id: number
username: string
@ -11,7 +37,6 @@ export type User = {
characters: Character[]
}
// Character model
export type Character = {
id: number
userId: number
@ -28,33 +53,47 @@ export type Character = {
zoneId: number
zone: Zone
chats: Chat[]
items: CharacterItem[]
}
export type CharacterItem = {
id: number
characterId: number
character: Character
itemId: string
item: Item
quantity: number
}
export type TileTag = {
tile: string
tags: any // Using 'any' for Json type, consider using a more specific type if possible
}
// Zone model
export type Zone = {
id: number
name: string
width: number
height: number
tiles: number[][]
walls: number[][]
decorations: ZoneDecoration[]
tiles: any // Using 'any' for Json type, consider using a more specific type if possible
walls: any // Using 'any' for Json type, consider using a more specific type if possible
zoneObjects: ZoneObject[]
characters: Character[]
chats: Chat[]
createdAt: Date
updatedAt: Date
}
export type ZoneDecoration = {
export type ZoneObject = {
id: number
zoneId: number
zone: Zone
type: number
objectId: string
object: Object
position_x: number
position_y: number
}
// Chat model
export type Chat = {
id: number
characterId: number
@ -64,10 +103,3 @@ export type Chat = {
message: string
createdAt: Date
}
export type Asset = {
key: string
value: string
group: 'tiles' | 'objects' | 'sound' | 'music' | 'ui' | 'font' | 'other'
type: 'base64' | 'link'
}