Reputation:
Let us suppose i save in memory the name of a room - "1-1". How would i go around to access that room object without having access to any creep/structure in that room? Something like:
function(roomName){
var room = Game.rooms.roomName; //what would the simplest and quickest code be?
}
Thanks in advance.
Upvotes: 4
Views: 4098
Reputation: 4545
You can't access a room if you have no objects inside it. It is like the fog of war. In order to see what is inside a room (in other words, to get access to the room object instance) you have to send some of your creeps there.
UPDATE: Game.rooms
property has been added to the API.
Upvotes: 6