-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated jshint added "unused": true #363
Conversation
fixed issues fixed similar code: the `roles.[role].died` function fixed complexity for brain.handleUnexpectedDeadCreeps by extracting functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing i seen which may need a fix is call to executeEveryTick wrongly written (didn't verify but else, the method should be renamed ^^'). About returnCode, i think we need a good return policy until this we can remove all the ones you commented.
@@ -120,7 +120,7 @@ Creep.prototype.handleExtractor = function() { | |||
if (this.carry[key] === 0) { | |||
continue; | |||
} | |||
let returnCode = this.transfer(this.room.terminal, key); | |||
returnCode = this.transfer(this.room.terminal, key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may comment returncode here too.
@@ -13,7 +13,7 @@ Creep.prototype.getRoute = function() { | |||
|
|||
// Add room avoidance | |||
let route = []; | |||
let creep = this; | |||
//let creep = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove it totally
@@ -159,7 +159,7 @@ Creep.prototype.getEnergyFromStorage = function() { | |||
|
|||
Creep.prototype.repairStructure = function() { | |||
let structure = null; | |||
let i = null; | |||
//let i = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free to remove
creep: 2, | ||
role: 'squadheal' | ||
} | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure about that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, line 24 can be removed
}; | ||
//let getWalls = function(object) { | ||
// return object.structureType === STRUCTURE_WALL; | ||
//}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we now use propertyfilters. can be remove so i supose
creep: {} | ||
}; | ||
creep: {} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still strange for me x)
@@ -43,13 +43,13 @@ Room.prototype.checkExitsAreReachable = function() { | |||
|
|||
let exits = this.find(FIND_EXIT); | |||
let room = this; | |||
var callbackNew = function(roomName) { | |||
var callbackNew = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return room.getMemoryCostMatrix()
for line under ? ^^'
let costMatrix = room.getMemoryCostMatrix(); | ||
return costMatrix; | ||
}; | ||
for (let exit of exits) { | ||
// console.log(exit); | ||
let room = this; | ||
//let room = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free to remove
|
||
roles.autoattackmelee.preMove = function(creep) { | ||
// creep.log('!!!!!!!!!!!!!!!! Autoattacking'); | ||
if (creep.room.exectueEveryTicks(25)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exectue ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is correct.
We should rename the method ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^' didn't verify
}; | ||
//roles.squadheal.execute = function(creep) { | ||
// creep.log('Execute!!!'); | ||
//}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need tooAngel validation but pretty sure it can be totally removed. I remember i removed some call in room_my if i'm right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure :-)
I think we should get rid of the execute
function completely. This was the old system for executing creeps, if action
returns false, the main loop will execute execute
, this shouldn't happen anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like, especially enforcing it for the future.
IMHO all old code parts can be removed instead of comments.
We have version control if we want to check.
@@ -111,7 +132,7 @@ brain.cleanRooms = function() { | |||
if (Game.time % 300 === 0) { | |||
for (let name in Memory.rooms) { | |||
// Check for reserved rooms | |||
let memory = Memory.rooms[name]; | |||
//let memory = Memory.rooms[name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
@@ -213,7 +213,7 @@ Creep.prototype.buildRoad = function() { | |||
return false; | |||
} | |||
|
|||
var i; | |||
//var i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
creep: 2, | ||
role: 'squadheal' | ||
} | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, line 24 can be removed
@@ -1,12 +1,12 @@ | |||
Room.prototype.getFriends = function(object) { | |||
Room.prototype.getFriends = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ I don't understand that comment
|
||
roles.autoattackmelee.preMove = function(creep) { | ||
// creep.log('!!!!!!!!!!!!!!!! Autoattacking'); | ||
if (creep.room.exectueEveryTicks(25)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is correct.
We should rename the method ...
}; | ||
//roles.squadheal.execute = function(creep) { | ||
// creep.log('Execute!!!'); | ||
//}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure :-)
I think we should get rid of the execute
function completely. This was the old system for executing creeps, if action
returns false, the main loop will execute execute
, this shouldn't happen anymore.
A new review, yeah.
|
Would like to see this merged into master, mind fixing the conflicts? |
fixed issues
fixed similar code: the
roles.[role].died
functionfixed complexity for brain.handleUnexpectedDeadCreeps by extracting functions