import { Game } from '../../startup/Game' ; import { Rooms } from '../../models/Enums' ; import { MapBuilder } from './MapBuilder' ; export class Map { public rooms : Array < any > ; public mapBuilder : MapBuilder ; constructor ( game ) { this . mapBuilder = new MapBuilder ( game ) ; this . rooms = this . mapBuilder . buildMap ( ) ; } public getRoomById ( roomId ) { return this . rooms . find ( ( room ) => room . id === roomId ) || this . rooms [ roomId ] ; } }