hex-world
    Preparing search index...

    Interface ResourceDescriptor

    A resource type — ore, fish, forest yield. Fully JSON-serializable, so a resource set rides through a .hexpack manifest and a map's save file the same way terrain, liquid, and scatter descriptors do, and a pack can carry resources this library has never heard of.

    interface ResourceDescriptor {
        id: string;
        name: string;
        color: number;
        iconAssetId?: string;
        size?: number;
        yOffset?: number;
        placement?: ResourcePlacementRule;
        yields?: Record<string, number>;
    }
    Index

    Properties

    id: string

    Stable id written into the map's metadata channel. Keep it short — it is stored per cell.

    name: string
    color: number

    Icon tint. Also the fallback marker color when no icon texture is resolved.

    iconAssetId?: string

    Icon texture id, resolved through the registry passed to ResourceLayer. Without one (or without a matching entry) the resource draws as a flat colored disc, which is enough to read a map during development.

    size?: number

    Billboard width in world units. Default 0.55.

    yOffset?: number

    Height of the icon above the cell surface. Default 0.8.

    Placement rules for the generation pass.

    yields?: Record<string, number>

    Free-form per-turn yields ({ food: 2, production: 1 }) or any other game-specific numbers. The library never reads these — they ride along so a pack's resources arrive with their rules attached.