Better RoomRunner
This commit is contained in:
8
src/utils/funcs/getRoomCreeps.ts
Normal file
8
src/utils/funcs/getRoomCreeps.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const getRoomCreeps = (room: Room): Record<string, CreepMemory> => {
|
||||
return Object.keys(Memory.creeps)
|
||||
.filter(name => Memory.creeps[name].room === room.name)
|
||||
.reduce((creeps: Record<string, CreepMemory>, creepName: string) => {
|
||||
creeps[creepName] = Memory.creeps[creepName];
|
||||
return creeps;
|
||||
}, {});
|
||||
};
|
||||
Reference in New Issue
Block a user