require('SectorStation'); class Sector { constructor() { this.items = []; } init() { this.items.push(new SectorStation(4, 2)); this.items.forEach((item) => { item.init(); }); } update(delta) { this.items.forEach((item) => { item.update(delta); }); } draw(context, delta) { this.update(delta); this.items.forEach((item) => { item.draw(context, delta); }); } drawNav(context, gridSize, halfGridSize) { this.items.forEach((item) => { item.drawNav(context, gridSize, halfGridSize); }); } getItems() { return this.items; } getItemAt(position) { return this.items.find((item) => { return item.getPosition().x == position.x && item.getPosition().y == position.y; }); } handleResize(event) { this.items.forEach((item) => { item.handleResize(event); }); } dock() { this.items.forEach((item) => { item.dock(); }); } }