Improved performance of walking.
Switches to manual walking when close to target.
This commit is contained in:
11
ClassRoom.js
11
ClassRoom.js
@@ -15,16 +15,8 @@ class _Room extends Room {
|
||||
|
||||
//#region Checks
|
||||
|
||||
// Is the level changed?
|
||||
isNewLevel() {
|
||||
if (this.memory.level == undefined) this.memory.level = -1;
|
||||
const value = this.controller.my && this.controller.level != this.memory.level;
|
||||
if (value) this.memory.level = this.controller.level;
|
||||
return value;
|
||||
}
|
||||
|
||||
// Is the max amount of construction sites achieved?
|
||||
isConstructionQueueFull() { return this.find(FIND_CONSTRUCTION_SITES).length > 90; }
|
||||
canConstruct() { return this.find(FIND_CONSTRUCTION_SITES).length < 90; }
|
||||
//#endregion
|
||||
|
||||
//#region Construcion
|
||||
@@ -62,7 +54,6 @@ class _Room extends Room {
|
||||
});
|
||||
|
||||
// Build a road for every permutation of the targets.
|
||||
// TODO: When performance to high make this loop recoverable.
|
||||
for (let i = 0; i < target_array.length; i++) {
|
||||
const begin = target_array[i];
|
||||
for (let j = 0; j < target_array.length; j++) {
|
||||
|
||||
Reference in New Issue
Block a user