screepers / Screeps-Typescript-Declarations

The repository for *Screeps's* TypeScript type definitions.
69 stars 44 forks source link

Fixed two minor bugs in the helpers #74

Closed Remz-Jay closed 8 years ago

Remz-Jay commented 8 years ago

Hey guys,

Great work you're doing with the declarations, really appreciated! Keep it up! 👍

I migrated to the #TS2 branch, and only two things broke on my part, both of which I monkey patched previously on my own copy. I do believe both patches are valid though, so here goes:

1 : A PathFinder roomCallback (which is dubbed costCallback in FindPathOpts ) can return false if a room is not to be searched. path-finder.ts already has the correct return value, but the FindPathOpts helper did not. See http://support.screeps.com/hc/en-us/articles/207023879-PathFinder#search for the docs on the callback. I quote:

If you return false from the callback the requested room will not be searched, and it won't count against maxRooms

2: lookForAt and lookForAtArea (both in Room) can use the LOOK_RESOURCES constant as a parameter. That constant is defined as LOOK_RESOURCES: "resource",, which will result in a resource parameter being set in the resulting LookAtResultWithPos or LookAtResult, which was missing from the definitions.

Thanks!

NhanHo commented 8 years ago

Thanks!