82 lines
1.4 KiB
TypeScript
82 lines
1.4 KiB
TypeScript
import { randomUUID } from 'node:crypto'
|
|
import { Entity, ManyToOne, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'
|
|
import { BaseEntity } from '#application/bases/baseEntity'
|
|
import { Zone } from './zone'
|
|
import { ZoneEventTile } from './zoneEventTile'
|
|
import { UUID } from '#application/types'
|
|
|
|
@Entity()
|
|
export class ZoneEventTileTeleport extends BaseEntity {
|
|
@PrimaryKey()
|
|
id = randomUUID()
|
|
|
|
@OneToOne(() => ZoneEventTile)
|
|
zoneEventTile!: ZoneEventTile
|
|
|
|
@ManyToOne(() => Zone)
|
|
toZone!: Zone
|
|
|
|
@Property()
|
|
toRotation!: number
|
|
|
|
@Property()
|
|
toPositionX!: number
|
|
|
|
@Property()
|
|
toPositionY!: number
|
|
|
|
setId(id: UUID) {
|
|
this.id = id
|
|
return this
|
|
}
|
|
|
|
getId() {
|
|
return this.id
|
|
}
|
|
|
|
setZoneEventTile(zoneEventTile: ZoneEventTile) {
|
|
this.zoneEventTile = zoneEventTile
|
|
return this
|
|
}
|
|
|
|
getZoneEventTile() {
|
|
return this.zoneEventTile
|
|
}
|
|
|
|
setToZone(toZone: Zone) {
|
|
this.toZone = toZone
|
|
return this
|
|
}
|
|
|
|
getToZone() {
|
|
return this.toZone
|
|
}
|
|
|
|
setToRotation(toRotation: number) {
|
|
this.toRotation = toRotation
|
|
return this
|
|
}
|
|
|
|
getToRotation() {
|
|
return this.toRotation
|
|
}
|
|
|
|
setToPositionX(toPositionX: number) {
|
|
this.toPositionX = toPositionX
|
|
return this
|
|
}
|
|
|
|
getToPositionX() {
|
|
return this.toPositionX
|
|
}
|
|
|
|
setToPositionY(toPositionY: number) {
|
|
this.toPositionY = toPositionY
|
|
return this
|
|
}
|
|
|
|
getToPositionY() {
|
|
return this.toPositionY
|
|
}
|
|
}
|