Skip to content

Commit

Permalink
settings consolidation, signature bugfix, header added to first compi…
Browse files Browse the repository at this point in the history
…led file
  • Loading branch information
bencbartlett committed Mar 22, 2018
1 parent 98faaa7 commit 0668a87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/prototypes/prototypes_Room.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Room prototypes - commonly used room properties and methods

import {myUsername} from '../settings/settings_user';
import {overmindSignature} from '../settings/do-not-modify';
import {myUsername, signature} from '../settings/settings_user';

// Logging =============================================================================================================
Object.defineProperty(Room.prototype, 'print', {
Expand All @@ -26,7 +25,7 @@ Object.defineProperty(Room.prototype, 'reservedByMe', {

Object.defineProperty(Room.prototype, 'signedByMe', {
get() {
return this.controller && this.controller.sign && this.controller.sign.text == overmindSignature;
return this.controller && this.controller.sign && this.controller.sign.text == signature;
},
});

Expand Down
5 changes: 2 additions & 3 deletions src/prototypes/prototypes_Structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

// General structure prototypes ========================================================================================

import {overmindSignature} from '../settings/do-not-modify';
import {myUsername} from '../settings/settings_user';
import {myUsername, signature} from '../settings/settings_user';
import {DirectiveLabMineral} from '../directives/logistics/directive_labMineralType';

Object.defineProperty(StructureContainer.prototype, 'isPassible', {
Expand Down Expand Up @@ -44,7 +43,7 @@ Object.defineProperty(StructureController.prototype, 'reservedByMe', {

Object.defineProperty(StructureController.prototype, 'signedByMe', {
get: function () {
return this.sign && this.sign.text == overmindSignature;
return this.sign && this.sign.text == signature;
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/settings/settings_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export var myUsername: string = getUsername(); // Your username
// will eventually include features limiting aggression toward new players on public servers and preferably targeting
// other bots.

var overmindSignature = 'Overmind Screeps AI'; // <DO-NOT-MODIFY> see license for details
let overmindSignature = 'Overmind Screeps AI'; // <DO-NOT-MODIFY> see license for details

let suffix = ''; // Put your signature suffix here; will be signed as "Overmind Screeps AI: <suffix>"

Expand Down
6 changes: 3 additions & 3 deletions src/tasks/task_signController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Task} from './Task';
import {profile} from '../profiler/decorator';
import {overmindSignature} from '../settings/do-not-modify';
import {signature} from '../settings/settings_user';

export type signControllerTargetType = StructureController;
export const signControllerTaskName = 'signController';
Expand All @@ -19,11 +19,11 @@ export class TaskSignController extends Task {

isValidTarget() {
let controller = this.target;
return (!controller.sign || controller.sign.text != overmindSignature);
return (!controller.sign || controller.sign.text != signature);
}

work() {
return this.creep.signController(this.target, overmindSignature);
return this.creep.signController(this.target, signature);
}
}

0 comments on commit 0668a87

Please sign in to comment.