exaV / screeps-kotlin-types

Screep's Kotlin type definitions
MIT License
17 stars 18 forks source link

Cannot moveByPath with the result of a PathFinder.search #70

Closed wesleyhall closed 3 years ago

wesleyhall commented 3 years ago

In the screeps API docs it is suggested that the argument to Creep.moveByPath can either be the result of Room.findPath in both plain and serialised form, or the result of PathFinder.search:

https://docs.screeps.com/api/#Creep.moveByPath

It appears that the kotlin types do not support the last of these options. The GenericCreep interface provides:

fun moveByPath(path: Array<Room.PathStep>): ScreepsReturnCode
fun moveByPath(serializedPath: String): ScreepsReturnCode

If the docs are correct this may just be a matter of introducing:

fun moveByPath(path: PathFinder.Path): ScreepsReturnCode
wesleyhall commented 3 years ago

Ok, I did a quick check on the console in Javascript. The above is not quite right. moveByPath does not accept PathFinder.Path but it does accept the value in the .path property of PathFinder.Path which is Array<RoomPosition>, so I think the correct addition is...

fun moveByPath(path: Array<RoomPosition>): ScreepsReturnCode
exaV commented 3 years ago

fixed in #71