refactor: send initial entity state
This commit is contained in:
parent
db11cffe80
commit
dd0f4da9ad
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user