25 lines
595 B
TypeScript
25 lines
595 B
TypeScript
import { game } from "../game"
|
|
import { levelState } from "./levelState"
|
|
|
|
export class dungeonData{
|
|
entranceId : string
|
|
rooms : levelState[] = []
|
|
playerCount : number = 0
|
|
|
|
constructor(id:string) {
|
|
this.entranceId = id
|
|
}
|
|
|
|
getRoom(roomId : string, create : boolean){
|
|
let room = this.rooms.find(r=>r.id == roomId)
|
|
|
|
if(room == null && create){
|
|
room = new levelState(roomId, -1)
|
|
room.isDungeon = true
|
|
this.rooms.push(room)
|
|
game.lobbyState.rooms.push(room)
|
|
}
|
|
|
|
return room
|
|
}
|
|
} |