ecspresso
    Preparing search index...

    Interface TimerComponentTypes<Slots>

    Component types provided by the timer plugin.

    Each entity carries a single timers component whose value is a map of named slots. This lets one entity host independent phase clocks (e.g. { launch: ..., shieldDepletion: ..., hangarCycle: ... }) without one timer's lifecycle constraining another.

    const ecs = ECSpresso.create()
    .withPlugin(createTimerPlugin())
    .withComponentTypes<{ fighter: true }>()
    .build();

    ecs.spawn({
    fighter: true,
    timers: { launch: createTimer(2.0) },
    });
    interface TimerComponentTypes<Slots extends string = string> {
        timers: Partial<Record<Slots, Timer<Slots>>>;
    }

    Type Parameters

    • Slots extends string = string
    Index

    Properties

    Properties

    timers: Partial<Record<Slots, Timer<Slots>>>