Files
screeps-scripts/src/utils/funcs/getRoomCreeps.ts
2025-07-15 19:36:25 -03:00

9 lines
360 B
TypeScript

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;
}, {});
};