-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
62 lines (52 loc) · 1.38 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// setup globals and prototypes
require('require');
// Imports
var handler_creep = require('handler.creep');
var handler_structure = require('handler.structure');
var human_resources = require('handler.human_resources');
var clean_up = require('handler.clean_up');
var reporter = require('handler.reporter');
var hud = require('handler.hud');
// Export module
module.exports.loop = function ()
{
// Report statuses
try {
reporter.statusReport();
}
catch (err) {
logger.error('Failed status report: ' + err);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Display room HUD
try {
hud.displayRoomHUD();
}
catch (err) {
logger.error('Failed displaying room HUD: ' + err);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Spawn required creeps
try {
human_resources.employRequiredCreeps();
}
catch (err) {
logger.error('Failed employing creeps: ' + err);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Perform all creep actions
try {
handler_creep.performCreepActions();
}
catch (err) {
logger.error('Failed performing creep actions: ' + err);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Clean up
try {
clean_up.cleanUp();
}
catch (err) {
logger.error('Failed clean up: ' + err);
}
}