Files
screeps/_rooms.js

21 lines
460 B
JavaScript

module.exports = {
start: function () {
for (const room_name in Game.rooms) {
const room = Game.rooms[room_name];
room.init();
}
},
update: function () {
for (const room_name in Game.rooms) {
const room = Game.rooms[room_name];
if (Game.time % 100 == 0) {
// Place new building types if the max construcion sites isn't achieved yet.
if (room.canConstruct()) {
room.planRoads();
room.planStructures();
}
}
}
}
}