import { Task } from '../Task' ; export type buildTargetType = ConstructionSite ; export class TaskBuild extends Task { static taskName = 'build' ; target : buildTargetType ; constructor ( target , options = { } as TaskOptions ) { super ( TaskBuild . 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 && this . target . progress < this . target . progressTotal ; } work ( ) { return this . creep . build ( this . target ) ; } }