Skip to content

Commit 80033cc

Browse files
authored
Merge pull request #74 from Remz-Jay/TS2
Fixed two minor bugs in the helpers
2 parents d88ada3 + 72b3462 commit 80033cc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/screeps.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ interface LookAtResultWithPos {
764764
exit?: any;
765765
source?: Source;
766766
mineral?: Mineral;
767+
resource?: Resource;
767768
}
768769
interface LookAtResult {
769770
type: string;
@@ -776,6 +777,7 @@ interface LookAtResult {
776777
structure?: Structure;
777778
terrain?: string;
778779
mineral?: Mineral;
780+
resource?: Resource;
779781
}
780782
interface LookAtResultMatrix {
781783
[coord: number]: LookAtResultMatrix | LookAtResult[];
@@ -806,7 +808,7 @@ interface FindPathOpts {
806808
* @param costMatrix The current CostMatrix
807809
* @returns The new CostMatrix to use
808810
*/
809-
costCallback?(roomName: string, costMatrix: CostMatrix): CostMatrix;
811+
costCallback?(roomName: string, costMatrix: CostMatrix): boolean | CostMatrix;
810812
/**
811813
* An array of the room's objects or RoomPosition objects which should be treated as walkable tiles during the search. This option
812814
* cannot be used when the new PathFinder is enabled (use costCallback option instead).

src/helpers.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ interface LookAtResultWithPos {
5858
exit?: any;
5959
source?: Source;
6060
mineral?: Mineral;
61+
resource? : Resource;
6162
}
6263
interface LookAtResult {
6364
type: string;
@@ -70,6 +71,7 @@ interface LookAtResult {
7071
structure?: Structure;
7172
terrain?: string;
7273
mineral?: Mineral;
74+
resource?: Resource;
7375
}
7476

7577

@@ -106,7 +108,7 @@ interface FindPathOpts {
106108
* @param costMatrix The current CostMatrix
107109
* @returns The new CostMatrix to use
108110
*/
109-
costCallback?(roomName: string, costMatrix: CostMatrix): CostMatrix;
111+
costCallback?(roomName: string, costMatrix: CostMatrix): boolean | CostMatrix;
110112

111113
/**
112114
* An array of the room's objects or RoomPosition objects which should be treated as walkable tiles during the search. This option

0 commit comments

Comments
 (0)