- findCached<K, C, V>(type, defaultOpts): ((name, opts?) => readonly C[])
-
Type Parameters
-
K extends FindCacheableConstant
-
C extends Partial<V> & {
id: Id<V>;
pos: RoomPosition;
room?: undefined;
} & OpaqueTag<"CachedObject", C>
-
V extends StructureSpawn | StructureController | Creep | PowerCreep | StructureLink | StructureExtension | StructureRampart | StructureRoad | StructureWall | StructureStorage | StructureTower | StructureObserver | StructurePowerSpawn | StructureExtractor | StructureLab | StructureTerminal | StructureContainer | StructureNuker | StructureFactory | StructureKeeperLair | StructurePowerBank | StructurePortal | StructureInvaderCore | Source | Resource<ResourceConstant> | ConstructionSite<BuildableStructureConstant> | Mineral<MineralConstant> | Nuke | Tombstone | Deposit | Ruin = FindTypes[K]
Parameters
-
type: K
-
defaultOpts: CacheOpts<C> & Partial<FilterOptions<K, V>> & PartialIfExtends<{
map: ((v) => Untag<C>);
}, CachedObject<V>, C>
Returns ((name, opts?) => readonly C[])
an array of CachedObject
-
- (name, opts?): readonly C[]
-
Parameters
-
-
Optional
opts: CacheOpts<C>
Returns readonly C[]
Like Room.find with CachedObject