代码ts化, 修复编译上传脚本

This commit is contained in:
jie
2024-11-03 22:04:05 +08:00
parent 916150eea2
commit 57c28c29ef
21 changed files with 410 additions and 216 deletions

12
src/modules/util.ts Normal file
View 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
)
}
})
}