import { Task } from '../Task' ; export type upgradeTargetType = StructureController ; export class TaskUpgrade extends Task { static taskName = 'upgrade' ; target : upgradeTargetType ; constructor ( target , options = { } as TaskOptions ) { super ( TaskUpgrade . taskName , target , options ) ; this . settings . targetRange = 3 ; this . settings . workOffRoad = true ; } isValidTask ( ) { return ( this . creep . carry . energy > 0 ) ; } isValidTarget ( ) { return this . target && this . target . my ; } work ( ) { return this . creep . upgradeController ( this . target ) ; } }