Improved folder and file structure, separated prisma schema into multiple ones, removed obsolete functions, worked on dynamic character sprite logics, general enhancements
This commit is contained in:
74
prisma/schema/zone.prisma
Normal file
74
prisma/schema/zone.prisma
Normal file
@ -0,0 +1,74 @@
|
||||
model Tile {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
tags Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Object {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
tags Json?
|
||||
origin_x Decimal @default(0)
|
||||
origin_y Decimal @default(0)
|
||||
isAnimated Boolean @default(false)
|
||||
frameSpeed Int @default(0)
|
||||
frameWidth Int @default(0)
|
||||
frameHeight Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
ZoneObject ZoneObject[]
|
||||
}
|
||||
|
||||
model Item {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
description String?
|
||||
stackable Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
characters CharacterItem[]
|
||||
}
|
||||
|
||||
model Zone {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
width Int @default(10)
|
||||
height Int @default(10)
|
||||
tiles Json?
|
||||
pvp Boolean @default(false)
|
||||
zoneEventTiles ZoneEventTile[]
|
||||
zoneObjects ZoneObject[]
|
||||
characters Character[]
|
||||
chats Chat[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ZoneObject {
|
||||
id String @id @default(uuid())
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
objectId String
|
||||
object Object @relation(fields: [objectId], references: [id], onDelete: Cascade)
|
||||
depth Int @default(0)
|
||||
position_x Int @default(0)
|
||||
position_y Int @default(0)
|
||||
}
|
||||
|
||||
enum ZoneEventTileType {
|
||||
BLOCK
|
||||
WARP
|
||||
NPC
|
||||
ITEM
|
||||
}
|
||||
|
||||
model ZoneEventTile {
|
||||
id String @id @default(uuid())
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
type ZoneEventTileType
|
||||
position_x Int
|
||||
position_y Int
|
||||
}
|
Reference in New Issue
Block a user