代码ts化, 修复编译上传脚本
This commit is contained in:
12
src/modules/util.ts
Normal file
12
src/modules/util.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function FindCapacity(creep: Creep) {
|
||||
return creep.room.find(FIND_STRUCTURES, {
|
||||
filter: (structure: StructureSpawn | StructureExtension) => {
|
||||
let type = structure.structureType;
|
||||
return (
|
||||
(type == STRUCTURE_EXTENSION ||
|
||||
type == STRUCTURE_SPAWN) &&
|
||||
structure.store.getFreeCapacity() != null && structure.store.getFreeCapacity() as number > 0
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user