screeps-clockwork 0.5.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/index.js +482 -665
- package/dist/index.js.map +1 -1
- package/dist/screeps_clockwork.wasm +0 -0
- package/dist/src/index.d.ts +3 -2
- package/dist/src/utils/cleanup.d.ts +23 -0
- package/dist/src/wasm/screeps_clockwork.d.ts +75 -78
- package/dist/src/wrappers/astarDistanceMap.d.ts +35 -0
- package/dist/src/wrappers/bfsDistanceMap.d.ts +18 -29
- package/dist/src/wrappers/dijkstraDistanceMap.d.ts +18 -27
- package/dist/src/wrappers/distanceMap.d.ts +0 -5
- package/dist/src/wrappers/flowField.d.ts +0 -6
- package/dist/src/wrappers/getTerrainCostMatrix.d.ts +6 -0
- package/dist/src/wrappers/monoFlowField.d.ts +0 -6
- package/dist/src/wrappers/multiroomDistanceMap.d.ts +12 -2
- package/dist/src/wrappers/multiroomFlowField.d.ts +2 -2
- package/dist/src/wrappers/multiroomMonoFlowField.d.ts +2 -2
- package/dist/src/wrappers/path.d.ts +3 -3
- package/dist/src/wrappers/searchResult.d.ts +7 -0
- package/package.json +4 -2
- package/dist/src/wrappers/bfsFlowField.d.ts +0 -84
- package/dist/src/wrappers/dijkstraFlowField.d.ts +0 -76
@@ -1,84 +0,0 @@
|
|
1
|
-
import { ClockworkCostMatrix } from '../wasm/screeps_clockwork';
|
2
|
-
import { ClockworkFlowField } from './flowField';
|
3
|
-
import { ClockworkMonoFlowField } from './monoFlowField';
|
4
|
-
import { ClockworkMultiroomFlowField } from './multiroomFlowField';
|
5
|
-
import { ClockworkMultiroomMonoFlowField } from './multiroomMonoFlowField';
|
6
|
-
/**
|
7
|
-
* Generate a [flow field](https://glitchassassin.github.io/screeps-clockwork/primitives/flowfield.html) for a set of positions
|
8
|
-
* using a breadth-first search algorithm.
|
9
|
-
*
|
10
|
-
* The BFS algorithm doesn't include variable costs, and only considers
|
11
|
-
* values of 255 (impassible) in the provided cost matrix. Any other
|
12
|
-
* values are ignored.
|
13
|
-
*
|
14
|
-
* This might be useful for creeps with only MOVE parts and/or empty
|
15
|
-
* CARRY parts, which don't generate fatigue.
|
16
|
-
*
|
17
|
-
* @param start - The starting positions.
|
18
|
-
* @param costMatrix - The cost matrix to use for the flow field.
|
19
|
-
* @returns The flow field.
|
20
|
-
*/
|
21
|
-
export declare function bfsFlowField(start: RoomPosition[], costMatrix: ClockworkCostMatrix): ClockworkFlowField;
|
22
|
-
/**
|
23
|
-
* Generate a [mono-directional flow field](https://glitchassassin.github.io/screeps-clockwork/primitives/flowfield.html)
|
24
|
-
* for a set of positions using a breadth-first search algorithm.
|
25
|
-
*
|
26
|
-
* The BFS algorithm doesn't include variable costs, and only considers
|
27
|
-
* values of 255 (impassible) in the provided cost matrix. Any other
|
28
|
-
* values are ignored.
|
29
|
-
*
|
30
|
-
* This might be useful for creeps with only MOVE parts and/or empty
|
31
|
-
* CARRY parts, which don't generate fatigue.
|
32
|
-
*
|
33
|
-
* Note that the `roomName` on start positions is ignored - all positions
|
34
|
-
* are assumed to be in the same room as the cost matrix.
|
35
|
-
*
|
36
|
-
* @param start - The starting positions.
|
37
|
-
* @param costMatrix - The cost matrix to use for the flow field.
|
38
|
-
* @returns The flow field.
|
39
|
-
*/
|
40
|
-
export declare function bfsMonoFlowField(start: RoomPosition[], costMatrix: ClockworkCostMatrix): ClockworkMonoFlowField;
|
41
|
-
/**
|
42
|
-
* Generate a multiroom flow field for a set of positions using a breadth-first search algorithm.
|
43
|
-
*
|
44
|
-
* The BFS algorithm doesn't include variable costs, and only considers
|
45
|
-
* values of 255 (impassible) in the provided cost matrix. Any other
|
46
|
-
* values are ignored.
|
47
|
-
*
|
48
|
-
* This might be useful for creeps with only MOVE parts and/or empty
|
49
|
-
* CARRY parts, which don't generate fatigue.
|
50
|
-
*
|
51
|
-
* @param start - The starting positions.
|
52
|
-
* @param costMatrixCallback - A function that returns a cost matrix for a given room name.
|
53
|
-
* @param options - Options for the flow field generation.
|
54
|
-
* @returns The flow field.
|
55
|
-
*/
|
56
|
-
export declare function bfsMultiroomFlowField(start: RoomPosition[], { costMatrixCallback, maxTiles, maxRooms, maxRoomDistance, maxTileDistance }: {
|
57
|
-
costMatrixCallback: (roomName: string) => ClockworkCostMatrix | undefined;
|
58
|
-
maxTiles?: number;
|
59
|
-
maxRooms?: number;
|
60
|
-
maxRoomDistance?: number;
|
61
|
-
maxTileDistance?: number;
|
62
|
-
}): ClockworkMultiroomFlowField;
|
63
|
-
/**
|
64
|
-
* Generate a multiroom mono-directional flow field for a set of positions using a breadth-first search algorithm.
|
65
|
-
*
|
66
|
-
* The BFS algorithm doesn't include variable costs, and only considers
|
67
|
-
* values of 255 (impassible) in the provided cost matrix. Any other
|
68
|
-
* values are ignored.
|
69
|
-
*
|
70
|
-
* This might be useful for creeps with only MOVE parts and/or empty
|
71
|
-
* CARRY parts, which don't generate fatigue.
|
72
|
-
*
|
73
|
-
* @param start - The starting positions.
|
74
|
-
* @param getCostMatrix - A function that returns a cost matrix for a given room name.
|
75
|
-
* @param options - Options for the flow field generation.
|
76
|
-
* @returns The flow field.
|
77
|
-
*/
|
78
|
-
export declare function bfsMultiroomMonoFlowField(start: RoomPosition[], { costMatrixCallback, maxTiles, maxRooms, maxRoomDistance, maxTileDistance }: {
|
79
|
-
costMatrixCallback: (roomName: string) => ClockworkCostMatrix | undefined;
|
80
|
-
maxTiles?: number;
|
81
|
-
maxRooms?: number;
|
82
|
-
maxRoomDistance?: number;
|
83
|
-
maxTileDistance?: number;
|
84
|
-
}): ClockworkMultiroomMonoFlowField;
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import { ClockworkCostMatrix } from '../wasm/screeps_clockwork';
|
2
|
-
import { ClockworkFlowField } from './flowField';
|
3
|
-
import { ClockworkMonoFlowField } from './monoFlowField';
|
4
|
-
import { ClockworkMultiroomFlowField } from './multiroomFlowField';
|
5
|
-
import { ClockworkMultiroomMonoFlowField } from './multiroomMonoFlowField';
|
6
|
-
/**
|
7
|
-
* Generate a [flow field](https://glitchassassin.github.io/screeps-clockwork/primitives/flowfield.html) for a set of positions
|
8
|
-
* using Dijkstra's algorithm.
|
9
|
-
*
|
10
|
-
* Dijkstra's algorithm includes variable costs to account for terrain or other cost functions.
|
11
|
-
*
|
12
|
-
* Note that values of 0 in the cost matrix may have unexpected behavior. You probably want
|
13
|
-
* a cost matrix with a default value of at least 1.
|
14
|
-
*
|
15
|
-
* @param start - The starting positions.
|
16
|
-
* @param costMatrix - The cost matrix to use for the flow field.
|
17
|
-
* @returns The flow field.
|
18
|
-
*/
|
19
|
-
export declare function dijkstraFlowField(start: RoomPosition[], costMatrix: ClockworkCostMatrix): ClockworkFlowField;
|
20
|
-
/**
|
21
|
-
* Generate a [mono-directional flow field](https://glitchassassin.github.io/screeps-clockwork/primitives/flowfield.html)
|
22
|
-
* for a set of positions using Dijkstra's algorithm.
|
23
|
-
*
|
24
|
-
* Dijkstra's algorithm includes variable costs to account for terrain or other cost functions.
|
25
|
-
*
|
26
|
-
* Note that values of 0 in the cost matrix may have unexpected behavior. You probably want
|
27
|
-
* a cost matrix with a default value of at least 1.
|
28
|
-
*
|
29
|
-
* Note that the `roomName` on start positions is ignored - all positions
|
30
|
-
* are assumed to be in the same room as the cost matrix.
|
31
|
-
*
|
32
|
-
* @param start - The starting positions.
|
33
|
-
* @param costMatrix - The cost matrix to use for the flow field.
|
34
|
-
* @returns The flow field.
|
35
|
-
*/
|
36
|
-
export declare function dijkstraMonoFlowField(start: RoomPosition[], costMatrix: ClockworkCostMatrix): ClockworkMonoFlowField;
|
37
|
-
/**
|
38
|
-
* Generate a multiroom flow field for a set of positions using Dijkstra's algorithm.
|
39
|
-
*
|
40
|
-
* Dijkstra's algorithm includes variable costs to account for terrain or other cost functions.
|
41
|
-
*
|
42
|
-
* Note that values of 0 in the cost matrix may have unexpected behavior. You probably want
|
43
|
-
* a cost matrix with a default value of at least 1.
|
44
|
-
*
|
45
|
-
* @param start - The starting positions.
|
46
|
-
* @param costMatrixCallback - A function that returns a cost matrix for a given room name.
|
47
|
-
* @param options - Options for the flow field generation.
|
48
|
-
* @returns The flow field.
|
49
|
-
*/
|
50
|
-
export declare function dijkstraMultiroomFlowField(start: RoomPosition[], { costMatrixCallback, maxTiles, maxRooms, maxRoomDistance, maxTileDistance }: {
|
51
|
-
costMatrixCallback: (roomName: string) => ClockworkCostMatrix | undefined;
|
52
|
-
maxTiles?: number;
|
53
|
-
maxRooms?: number;
|
54
|
-
maxRoomDistance?: number;
|
55
|
-
maxTileDistance?: number;
|
56
|
-
}): ClockworkMultiroomFlowField;
|
57
|
-
/**
|
58
|
-
* Generate a multiroom mono-directional flow field for a set of positions using Dijkstra's algorithm.
|
59
|
-
*
|
60
|
-
* Dijkstra's algorithm includes variable costs to account for terrain or other cost functions.
|
61
|
-
*
|
62
|
-
* Note that values of 0 in the cost matrix may have unexpected behavior. You probably want
|
63
|
-
* a cost matrix with a default value of at least 1.
|
64
|
-
*
|
65
|
-
* @param start - The starting positions.
|
66
|
-
* @param costMatrixCallback - A function that returns a cost matrix for a given room name.
|
67
|
-
* @param options - Options for the flow field generation.
|
68
|
-
* @returns The flow field.
|
69
|
-
*/
|
70
|
-
export declare function dijkstraMultiroomMonoFlowField(start: RoomPosition[], { costMatrixCallback, maxTiles, maxRooms, maxRoomDistance, maxTileDistance }: {
|
71
|
-
costMatrixCallback: (roomName: string) => ClockworkCostMatrix | undefined;
|
72
|
-
maxTiles?: number;
|
73
|
-
maxRooms?: number;
|
74
|
-
maxRoomDistance?: number;
|
75
|
-
maxTileDistance?: number;
|
76
|
-
}): ClockworkMultiroomMonoFlowField;
|