forked from bonzaiferroni/Traveler
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
59 lines (52 loc) · 1.34 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
interface PathfinderReturn {
path: RoomPosition[];
ops: number;
cost: number;
incomplete: boolean;
}
interface TravelToReturnData {
nextPos?: RoomPosition;
pathfinderReturn?: PathfinderReturn;
state?: TravelState;
path?: string;
}
interface TravelToOptions {
ignoreRoads?: boolean;
ignoreCreeps?: boolean;
ignoreStructures?: boolean;
preferHighway?: boolean;
highwayBias?: number;
allowHostile?: boolean;
allowSK?: boolean;
range?: number;
obstacles?: {pos: RoomPosition}[];
roomCallback?: (roomName: string, matrix: CostMatrix) => CostMatrix | boolean;
routeCallback?: (roomName: string) => number;
returnData?: TravelToReturnData;
restrictDistance?: number;
useFindRoute?: boolean;
maxOps?: number;
movingTarget?: boolean;
freshMatrix?: boolean;
offRoad?: boolean;
stuckValue?: number;
maxRooms?: number;
repath?: number;
route?: {[roomName: string]: boolean};
ensurePath?: boolean;
}
interface TravelData {
state: any[];
path: string;
}
interface TravelState {
stuckCount: number;
lastCoord: Coord;
destination: RoomPosition;
cpu: number;
}
interface Creep {
travelTo(destination: HasPos|RoomPosition, ops?: TravelToOptions): number;
}
type Coord = {x: number, y: number};
type HasPos = {pos: RoomPosition}