import { Task } from '../Task' ; export type goToRoomTargetType = string ; export class TaskGoToRoom extends Task { static taskName = 'goToRoom' ; target : null ; constructor ( roomName , options = { } as TaskOptions ) { super ( TaskGoToRoom . taskName , { ref : '' , pos : new RoomPosition ( 25 , 25 , roomName ) } , options ) ; this . settings . targetRange = 24 ; } isValidTask ( ) { return ! this . creep . pos . inRangeTo ( this . targetPos , this . settings . targetRange ) ; } isValidTarget ( ) { return true ; } isValid ( ) { let validTask = false ; if ( this . creep ) { validTask = this . isValidTask ( ) ; } if ( validTask ) { return true ; } else { let isValid = false ; if ( this . parent ) { isValid = this . parent . isValid ( ) ; } this . finish ( ) ; return isValid ; } } work ( ) { return OK ; } }