chore: naming

This commit is contained in:
cha0s 2021-07-07 11:39:22 -05:00
parent fd33028918
commit a64a1533a7

View File

@ -3,7 +3,7 @@ import {Container} from '@avocado/graphics';
import TilesRenderable from './tiles';
const views = new Set();
const renderables = new Set();
export default class RoomRenderable extends Container {
@ -19,14 +19,14 @@ export default class RoomRenderable extends Container {
this.addChild(this.entityListView);
this.sort();
if (module.hot) {
views.add(this);
renderables.add(this);
}
}
destroy() {
super.destroy();
if (module.hot) {
views.delete(this);
renderables.delete(this);
}
}
@ -40,16 +40,16 @@ export default class RoomRenderable extends Container {
if (module.hot) {
module.hot.accept('./tiles', () => {
const it = views.values();
const it = renderables.values();
for (let value = it.next(); value.done !== true; value = it.next()) {
const {value: view} = value;
const {lastExtent} = view;
view.removeChild(view.entityListView);
view.removeChild(view.tilesRenderable);
view.tilesRenderable = new TilesRenderable(view.room.tiles, view.renderer);
view.renderChunksForExtent(lastExtent);
view.addChild(view.tilesRenderable);
view.addChild(view.entityListView);
const {value: renderable} = value;
const {lastExtent} = renderable;
renderable.removeChild(renderable.entityListView);
renderable.removeChild(renderable.tilesRenderable);
renderable.tilesRenderable = new TilesRenderable(renderable.room.tiles, renderable.renderer);
renderable.renderChunksForExtent(lastExtent);
renderable.addChild(renderable.tilesRenderable);
renderable.addChild(renderable.entityListView);
}
});
}