screeps-cartographer
Version:
An advanced (and open source) movement library for Screeps
18 lines (17 loc) • 785 B
TypeScript
/// <reference types="screeps" />
import { type MoveOpts, type MoveTarget } from 'lib';
export type CostMatrixMutator = (cm: CostMatrix, room: string) => CostMatrix;
export interface CostMatrixOptions {
avoidCreeps?: boolean;
avoidObstacleStructures?: boolean;
avoidSourceKeepers?: boolean;
ignorePortals?: boolean;
roadCost?: number;
avoidTargets?: (roomName: string) => MoveTarget[];
avoidTargetGradient?: number;
}
/**
* Mutates a cost matrix based on a set of options, and returns the mutated cost matrix.
*/
export declare const mutateCostMatrix: (cm: CostMatrix, room: string, opts: CostMatrixOptions) => CostMatrix;
export declare const configureRoomCallback: (actualOpts: MoveOpts, targetRooms?: string[]) => (room: string) => false | CostMatrix;