forked from noxious/server
Merged code
This commit is contained in:
@ -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();
|
Reference in New Issue
Block a user