Filtering on built structures only
-
Hi Guys,
I'm trying to find a way to filter out structures that are still under construction. Can anyone help with a filter to do this?
-
creep.room.find(FIND_STRUCTURES) will find all finished structures.
creep.room.find(FIND_CONSTRUCTION_SITES) will find all the construction sites (buildings under construction)
-
I seem to be getting back structures that are still under construction, very strange!
-
What properties does the object building under construction have?
The owned structure and construction site objects have similar properties. An owned structure has hits and hitsMax where a construction site has progress and progressTotal.
for a given structure if hits < hitsMax then that structure has been damaged and needs repairs.
-
You can always use instanceof to filter object types.