hex-world
    Preparing search index...

    Interface DomainCostOptions

    interface DomainCostOptions {
        map: HexMap;
        isLiquid: LiquidPredicate;
        domain: MovementDomain;
        landCost?: (
            col: number,
            row: number,
            from: { col: number; row: number },
        ) => number;
        navalCost?: (
            col: number,
            row: number,
            from: { col: number; row: number },
        ) => number;
        embarkCost?: number;
        embarkAt?: "ports" | "shore";
        dockAtPorts?: boolean;
    }
    Index

    Properties

    map: HexMap
    isLiquid: LiquidPredicate

    Which terrains float a ship. HexWorld.isWater or a buildWaterTerrainSet lookup.

    landCost?: (
        col: number,
        row: number,
        from: { col: number; row: number },
    ) => number

    Cost of a step onto a land cell, given the destination and the origin. Return Infinity for impassable. Default 1 everywhere — the place for terrain, slope, road, and river-ford rules.

    navalCost?: (
        col: number,
        row: number,
        from: { col: number; row: number },
    ) => number

    Cost of a step onto a liquid cell. Default 1. Shallow/deep, current, and ice rules go here.

    embarkCost?: number

    Added to a step that changes domain — land to liquid or back. Default 1. Amphibious units only; ships pay navalCost to dock.

    embarkAt?: "ports" | "shore"

    Where an amphibious unit may cross the shoreline: any shore ('shore', the default) or only through a port cell ('ports').

    dockAtPorts?: boolean

    Whether ships may enter port cells. Default true.