import Component from '@/ecs/component.js'; export default class Emitter extends Component { mergeDiff(original, update) { const merged = {}; if (update.emit) { merged.emit = { ...original.emit, ...update.emit, } } return merged; } instanceFromSchema() { const Component = this; const Instance = super.instanceFromSchema(); return class EmitterInstance extends Instance { emitting = []; id = 0; emit(specification) { Component.markChange(this.entity, 'emit', {[this.id++]: specification}); } }; } }