forked from noxious/server
Map event tile improvements
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Server } from 'socket.io'
|
||||
|
||||
import { TSocket } from '#application/types'
|
||||
import { TSocket, UUID } from '#application/types'
|
||||
import { Character } from '#entities/character'
|
||||
import MapManager from '#managers/mapManager'
|
||||
import SocketManager from '#managers/socketManager'
|
||||
@ -15,11 +15,15 @@ class MapCharacter {
|
||||
this.character = character
|
||||
}
|
||||
|
||||
public getCharacter(): Character {
|
||||
return this.character
|
||||
}
|
||||
|
||||
public async savePosition() {
|
||||
await this.character.setPositionX(this.character.positionX).setPositionY(this.character.positionY).setRotation(this.character.rotation).setMap(this.character.map).save()
|
||||
}
|
||||
|
||||
public async teleport(mapId: number, targetX: number, targetY: number): Promise<void> {
|
||||
public async teleport(mapId: UUID, targetX: number, targetY: number): Promise<void> {
|
||||
await TeleportService.teleportCharacter(this.character.id, {
|
||||
targetMapId: mapId,
|
||||
targetX,
|
||||
|
Reference in New Issue
Block a user