Worker abstraction
This commit is contained in:
parent
57c4ac1688
commit
e2e93947b5
5 changed files with 75 additions and 22 deletions
12
src/RoomPlanner/Blueprints/Containers.ts
Normal file
12
src/RoomPlanner/Blueprints/Containers.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export const buildContainers = (room: Room) => {
|
||||
if ((room.controller?.level ?? 0) < 2) {
|
||||
return;
|
||||
}
|
||||
const sources = room.find(FIND_SOURCES);
|
||||
for (const source of sources) {
|
||||
room.createConstructionSite(source.pos.x - 2, source.pos.y, STRUCTURE_CONTAINER);
|
||||
room.createConstructionSite(source.pos.x + 2, source.pos.y, STRUCTURE_CONTAINER);
|
||||
room.createConstructionSite(source.pos.x, source.pos.y - 2, STRUCTURE_CONTAINER);
|
||||
room.createConstructionSite(source.pos.x, source.pos.y + 2, STRUCTURE_CONTAINER);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue