Skip to content

Commit

Permalink
generify RoomPosition.findClosestByRange
Browse files Browse the repository at this point in the history
  • Loading branch information
exaV committed Sep 7, 2020
1 parent 700ab15 commit f48ed59
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/kotlin/screeps/api/RoomPosition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ external class RoomPosition(x: Int, y: Int, roomName: String) : NavigationTarget
secondaryColor: ColorConstant
): Any

fun <T> findClosestByPath(
objects: Array<RoomObject>,
fun <T : RoomObject> findClosestByPath(
objects: Array<T>,
opts: FindClosestByPathOptions<T> = definedExternally
): T?

Expand All @@ -26,8 +26,7 @@ external class RoomPosition(x: Int, y: Int, roomName: String) : NavigationTarget
): T?

fun <T : RoomObject> findClosestByRange(
type: FindConstant<T>,
objects: Array<NavigationTarget>,
objects: Array<T>,
opts: FilterOption<T> = definedExternally
): T?

Expand Down

0 comments on commit f48ed59

Please sign in to comment.