使用全局Memory存放所有建筑ID及分配的Creep, Creep内存存放工作建筑

This commit is contained in:
JIe
2024-11-04 16:10:50 +08:00
parent 36ea81e5e2
commit 2df2a171e7
7 changed files with 102 additions and 3566 deletions

15
src/index.d.ts vendored
View File

@@ -1,8 +1,21 @@
interface CreepMemory {
role: string,
working?: boolean | null,
working?: boolean,
source?:string,
workTarget?: Id<Structure>,
[property: string]: any,
}
interface MemoryStructure{
id: Id<Structure>,
structureType: string,
roomName: string
creep?: Id<Creep>,
}
interface Memory{
structures?: MemoryStructure[]
}
declare type Part = WORK | MOVE | CARRY | HEAL | ATTACK | RANGED_ATTACK | TOUGH | CLAIM;