import { Task } from '../Task' ; export type fortifyTargetType = StructureWall | StructureRampart ; export class TaskFortify extends Task { static taskName = 'fortify' ; target : fortifyTargetType ; constructor ( target , options = { } as TaskOptions ) { super ( TaskFortify . taskName , target , options ) ; this . settings . targetRange = 3 ; this . settings . workOffRoad = true ; } isValidTask ( ) { return ( this . creep . carry . energy > 0 ) ; } isValidTarget ( ) { let target = this . target ; return ( target != null && target . hits < target . hitsMax ) ; } work ( ) { return this . creep . repair ( this . target ) ; } }