#174: Refactor character manager into zoneManager for better DX, major refactor of time and weather system (data is stored in DB now instead of JSON file), npm update, npm format, many other improvements

This commit is contained in:
2024-11-13 13:21:01 +01:00
parent 628b3bf1fa
commit d4e0cbe398
43 changed files with 465 additions and 461 deletions

View File

@ -0,0 +1,25 @@
import { Character } from '@prisma/client'
import prisma from '../utilities/prisma'
class ZoneCharacter {
public readonly character: Character
public isMoving: boolean = false
constructor(character: Character) {
this.character = character
}
public async savePosition() {
await prisma.character.update({
where: { id: this.character.id },
data: {
positionX: this.character.positionX,
positionY: this.character.positionY,
rotation: this.character.rotation,
zoneId: this.character.zoneId
}
})
}
}
export default ZoneCharacter