wima
    Preparing search index...

    Class ComponentHooks

    Sets the functional hooks for listening on the lifecycle of a component i.e addition, insertion and removal. The component needs to be registered on a world before its hooks can be set.

    //a component
    class A {}

    function added(entity:Entity,world:World){
    console.log(`Entity {${entity}} with component A added`)
    }

    function inserted(entity:Entity,world:World){
    console.log(`Component A inserted into entity {${entity}}` )
    }

    function removed(entity:Entity,world:World){
    console.log(`Entity {${entity}} with component A removed`)
    }

    const world = new World()
    const hooks = new ComponentHooks(added,inserted,removed)

    world
    .registerType(A)
    .setComponentHooks(A,hooks)
    Index

    Constructors

    Properties

    Constructors

    Properties