@kognifai/cogsengine
    Preparing search index...

    Interface ComponentFactory<T>

    CogsInternal: factory for Components

    interface ComponentFactory<T extends Component> {
        type: string;
        create(): T;
        wrap(entity: Entity): T;
    }

    Type Parameters

    Index

    Properties

    Methods

    Properties

    type: string

    The type name of the component.

    Methods

    • Creates new Components of the type T. Use Entity.components.add() to add to one entity.

      Returns T

    • Creates wrapper for an existing Component owned by given Entity

      Parameters

      Returns T