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

    Class AbstractLoader<T>Abstract

    Abstract base class for all resource loaders.

    Type Parameters

    • T

      The type of resource returned by the loader.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    basePath: string = ""

    The base path for resource URLs.

    Methods

    • Dispatches an event.

      Parameters

      • type: string

        The event type.

      • eventData: Record<string, unknown> = {}

        Optional data associated with the event.

      Returns void

    • Loads a resource from the given URL.

      Parameters

      • url: string

        The relative URL to the resource.

      Returns Promise<T>

      A promise resolving to the loaded resource.

    • Sets the base path for the loader.

      Parameters

      • path: string

        The base path string.

      Returns this

      this