forked from noxious/server
OOP improvement
This commit is contained in:
parent
fc92d9ea79
commit
72d731c6f2
@ -11,7 +11,7 @@ interface Position {
|
||||
}
|
||||
|
||||
export class CharacterService {
|
||||
private static readonly MOVEMENT_DELAY_MS = 250
|
||||
private readonly MOVEMENT_DELAY_MS = 250
|
||||
|
||||
public updatePosition(character: Character, position: Position, newZoneId?: number): void {
|
||||
if (!this.isValidPosition(position)) {
|
||||
@ -49,7 +49,7 @@ export class CharacterService {
|
||||
}
|
||||
|
||||
public async applyMovementDelay(): Promise<void> {
|
||||
await new Promise((resolve) => setTimeout(resolve, CharacterService.MOVEMENT_DELAY_MS))
|
||||
await new Promise((resolve) => setTimeout(resolve, this.MOVEMENT_DELAY_MS))
|
||||
}
|
||||
|
||||
private isValidPosition(position: Position): boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user