1
0
forked from noxious/server

Merged code

This commit is contained in:
2024-09-09 20:13:07 +02:00
parent d7f441d570
commit d2e1837e75
3 changed files with 17 additions and 10 deletions

View File

@ -1,20 +1,20 @@
import { ExtendedCharacter } from '../utilities/types'
import { Zone } from '@prisma/client'
class CharacterManager {
private characters!: ExtendedCharacter[];
constructor() {
public async boot() {
this.characters = [];
}
public addCharacterToZone(character: ExtendedCharacter) {
public initCharacter(character: ExtendedCharacter) {
this.characters = [...this.characters, character]
}
public getCharactersByZone(zone: Zone) {
return this.characters.filter(x => x.zoneId === zone.id);
public getCharactersInZone(zone: Zone) {
return this.characters.filter(x => x.zoneId === zone.id);
}
}
}
export default new CharacterManager();