1
0
forked from noxious/server

Removed depth field from placedMapObject as this is calculated automatically

This commit is contained in:
2025-01-23 19:47:33 +01:00
parent 189fd39377
commit 1546deb811
6 changed files with 44 additions and 83 deletions

View File

@ -19,9 +19,6 @@ export class BasePlacedMapObject extends BaseEntity {
@ManyToOne({ deleteRule: 'cascade', eager: true })
mapObject!: MapObject
@Property()
depth = 0
@Property()
isRotated = false
@ -58,15 +55,6 @@ export class BasePlacedMapObject extends BaseEntity {
return this.mapObject
}
setDepth(depth: number) {
this.depth = depth
return this
}
getDepth() {
return this.depth
}
setIsRotated(isRotated: boolean) {
this.isRotated = isRotated
return this

View File

@ -2,6 +2,8 @@ import { Entity } from '@mikro-orm/core'
import { BaseMap } from '#entities/base/map'
export type MapCacheT = ReturnType<Map['cache']> | {}
@Entity()
export class Map extends BaseMap {
public async cache() {
@ -20,7 +22,6 @@ export class Map extends BaseMap {
placedMapObjects: this.getPlacedMapObjects().map((placedMapObject) => ({
id: placedMapObject.getId(),
mapObject: placedMapObject.getMapObject().getId(),
depth: placedMapObject.getDepth(),
isRotated: placedMapObject.getIsRotated(),
positionX: placedMapObject.getPositionX(),
positionY: placedMapObject.getPositionY()