refactor: send initial entity state

This commit is contained in:
cha0s 2019-10-01 22:42:26 -05:00
parent db11cffe80
commit dd0f4da9ad

View File

@ -204,6 +204,16 @@ export class EntityList extends decorate(class {}) {
}
}
toNetwork(informed) {
const {areaToInform} = informed;
const visibleEntities = this.visibleEntities(areaToInform);
// Mark as notified.
this._informedEntities.set(informed, visibleEntities);
return visibleEntities.map((entity) => {
return entity.mergeDiff();
});
}
toJSON() {
const json = [];
for (let i = 0; i < this._flatEntities.length; i++) {