file: ComponentListener.aus

class: ComponentListener

[26:7] extends: FxObj

Wraps FXGL's ComponentListener two-method interface (com.almasb.fxgl.entity.component.ComponentListener). Fires onAdded(component) when a Component is added to the entity it's watching, and onRemoved(component) when one is removed. Backed by AussomComponentListener because the interface has two methods (aji.closure only handles single-method functional interfaces). Register the listener via Entity.addComponentListener(listener.obj). Example: listener = new ComponentListener(::onAdded, ::onRemoved); e.addComponentListener(listener.obj); public onAdded(component) { ... } public onRemoved(component) { ... }

Methods