import * as SupData from "./index" ; import * as path from "path" ; export default class Resources extends SupData . Base . Dictionary { constructor ( public server ) { super ( ) ; } acquire ( id , owner , callback ) { if ( this . server . system . data . resourceClasses [ id ] == null ) { callback ( new Error ( `Invalid resource id: ${ id }` ) , null ) ; return ; } super . acquire ( id , owner , callback ) ; } _load ( id ) { const resourceClass = this . server . system . data . resourceClasses [ id ] ; const resource = new resourceClass ( id , null , this . server ) ; resource . load ( path . join ( this . server . projectPath , `resources/${ id }` ) ) ; return resource ; } }