Skip to content

Commit

Permalink
Minor formatting changes and dead code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumstate committed Mar 24, 2012
1 parent d0321f1 commit 0964d6c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
3 changes: 1 addition & 2 deletions attackMoveToCC.js
@@ -1,4 +1,4 @@
var AttackMoveToCC = function(gameState, militaryManager){
function AttackMoveToCC(gameState, militaryManager){
this.minAttackSize = 20;
this.maxAttackSize = 60;
this.idList=[];
Expand Down Expand Up @@ -49,7 +49,6 @@ AttackMoveToCC.prototype.execute = function(gameState, militaryManager){
if (targets.length == 0) {
targets = militaryManager.getEnemyBuildings(gameState,"Village");
}


// If we have a target, move to it
if (targets.length) {
Expand Down
20 changes: 0 additions & 20 deletions entity-extend.js
Expand Up @@ -2,31 +2,11 @@ Entity.prototype.deleteMetadata = function(id) {
delete this._ai._entityMetadata[this.id()];
};

Entity.prototype.garrisonMax = function() {
if (!this._template.GarrisonHolder)
return undefined;
return this._template.GarrisonHolder.Max;
};

Entity.prototype.garrison = function(target) {
Engine.PostCommand({"type": "garrison", "entities": [this.id()], "target": target.id(),"queued": false});
return this;
};

Entity.prototype.unload = function(id) {
if (!this._template.GarrisonHolder)
return undefined;
Engine.PostCommand({"type": "unload", "garrisonHolder": this.id(), "entity": id});
return this;
};

Entity.prototype.unloadAll = function() {
if (!this._template.GarrisonHolder)
return undefined;
Engine.PostCommand({"type": "unload-all", "garrisonHolder": this.id()});
return this;
};

Entity.prototype.attack = function(unitId)
{
Engine.PostCommand({"type": "attack", "entities": [this.id()], "target": unitId, "queued": false});
Expand Down
2 changes: 1 addition & 1 deletion gamestate.js
Expand Up @@ -236,7 +236,7 @@ GameState.prototype.findBuilders = function(template) {

GameState.prototype.findFoundations = function(template) {
return this.getOwnEntities().filter(function(ent) {
return (typeof ent.foundationProgress() !== "undefined");
return (ent.foundationProgress() !== undefined);
});
};

Expand Down
2 changes: 1 addition & 1 deletion timer.js
Expand Up @@ -48,7 +48,7 @@ var Timer = function() {
// Check if a alarm has reached its interval.
this.checkTimer = function(gameState,id) {
var alarm = get_alarm(id);
if (alarm == undefined)
if (alarm === undefined)
return false;
if (!alarm.active)
return false;
Expand Down

0 comments on commit 0964d6c

Please sign in to comment.