Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set index type for describe exits #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dist/screeps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,11 @@ interface GameMap {
* @returns The exits information or null if the room not found.
*/
describeExits(roomName: string): {
"1"?: string;
"3"?: string;
"5"?: string;
"7"?: string;
[direction: number]: string | undefined;
readonly "1"?: string;
readonly "3"?: string;
readonly "5"?: string;
readonly "7"?: string;
};
/**
* Find the exit direction from the given room en route to another room.
Expand Down
10 changes: 8 additions & 2 deletions src/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ interface GameMap {
* @param roomName The room name.
* @returns The exits information or null if the room not found.
*/
describeExits(roomName: string): {"1"?: string, "3"?: string, "5"?: string, "7"?: string};
describeExits(roomName: string): {
[direction: number]: string | undefined;
readonly "1"?: string,
readonly "3"?: string,
readonly "5"?: string,
readonly "7"?: string
};
/**
* Find the exit direction from the given room en route to another room.
* @param fromRoom Start room name or room object.
Expand Down Expand Up @@ -60,7 +66,7 @@ interface GameMap {
* @param pos The position object.
*/
getTerrainAt(pos: RoomPosition): string;

/**
* Check if the room is available to move into.
* @param roomName The room name.
Expand Down