Small World Engine API Reference - v0.46.1
    Preparing search index...

    Interface StateConfig<TState, TContext, TEvent>

    interface StateConfig<
        TState extends string,
        TContext,
        TEvent extends string = string,
    > {
        autoTransition?: { duration: number; nextState: TState };
        onEnter?: (context: TContext, previousState: TState | null) => void;
        onExit?: (context: TContext, nextState: TState) => void;
        onUpdate?: (
            context: TContext,
            deltaTime: number,
            stateDuration: number,
        ) => void;
        transitions?: Partial<Record<TEvent, TState>>;
    }

    Type Parameters

    • TState extends string
    • TContext
    • TEvent extends string = string
    Index

    Properties

    autoTransition?: { duration: number; nextState: TState }
    onEnter?: (context: TContext, previousState: TState | null) => void
    onExit?: (context: TContext, nextState: TState) => void
    onUpdate?: (context: TContext, deltaTime: number, stateDuration: number) => void
    transitions?: Partial<Record<TEvent, TState>>