-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.creep.js
40 lines (39 loc) · 1.06 KB
/
handler.creep.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
// Export module
module.exports =
{
/*
* Perform Creep Actions
* Perform actions for each creep
*/
performCreepActions: function()
{
// Perform actions for each different creep type
for (let i in Game.creeps)
{
// Simplify
let creep = Game.creeps[i];
// Perform actions
switch (creep.memory.role)
{
case ROLES.harvester:
let role_harvester = require('role.harvester');
role_harvester.run(creep);
break;
case ROLES.builder:
let role_builder = require('role.builder');
role_builder.run(creep);
break;
case ROLES.upgrader:
let role_upgrader = require('role.upgrader');
role_upgrader.run(creep);
break;
case ROLES.transporters:
let role_transporter = require('roles.transporter');
role_transporter.run(creep);
break;
default:
break;
}
}
}
}