Add the rest of the "functional" structures to the Room or Game objects
-
We can access terminal and storage from the Room object, and spawns from the Game object. I would like to see more functional structures added (in order of usefulness)-
* Observer
* Nuker
* Power Spawn
-
You can just extend the Room prototype on your own.
```javascript
Object.defineProperties(Room.prototype,{
"powerspawn" : { get : _powerspawn },
"my" : { get : _my },
});function _powerspawn() { return this.find(FIND_MY_STRUCTURES,{filter:{structureType:STRUCTURE_POWER_SPAWN}})[0]; }
function _my() {
return this.controller && (this.controller.my || this.controller.reservation && this.controller.reservation.username === MY_NAME);
}```
To improve performance, you can add an additional caching step, which pulls the IDs from memory if available (which might not necessarily be faster depending on your memory structure).