screeps-cartographer
Version:
An advanced (and open source) movement library for Screeps
27 lines (26 loc) • 1.1 kB
TypeScript
/// <reference types="screeps" />
import type { MoveOpts, MoveTarget } from '..';
import { GenericCachingStrategy } from '../CachingStrategies';
declare global {
interface CreepMemory {
_cmvp?: string;
_cmvt?: string;
}
interface PowerCreepMemory {
_cmvp?: string;
_cmvt?: string;
}
}
/**
* Clears all data for a cached path (useful to force a repath)
*/
export declare function clearCachedPath(creep: Creep | PowerCreep, cache?: GenericCachingStrategy<any>): void;
/**
* Replacement for the builtin moveTo, but passes through options to PathFinder. Supports
* multiple targets, flee, etc. See `MoveOpts`.
*
* If fallbackOpts is specified, the options will override `opts` *only* if `repathIfStuck`
* triggers a repath. This lets you ignore creeps until a creep gets stuck, then repath around
* them, for example.
*/
export declare const moveTo: (creep: Creep | PowerCreep, targets: _HasRoomPosition | RoomPosition | MoveTarget | RoomPosition[] | MoveTarget[], opts?: MoveOpts, fallbackOpts?: MoveOpts) => -2 | -10 | CreepMoveReturnCode | -5;