-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
44 lines (32 loc) · 1.32 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
const tools = require('utils.tools');
const mount = require('utils.mount');
const logger = require('utils.log').getLogger("main");
const constructionLink = require('Construction_Link');
const constructionTower = require('Construction_Tower');
const constructionFactory = require('Construction_Factory');
const constructionTerminal = require('Construction_Terminal');
const creepManager = require('Creep_Manager');
const watcher = require('Watcher');
module.exports.loop = function () {
//挂载原型扩展
mount();
//建筑管理
constructionTower.towerWork();
constructionLink.linkTransfer();
constructionFactory.factoryWork();
//constructionTerminal.terminalWork();
//Creeps 工作
for (let name in Game.creeps) {
Game.creeps[name].work();
}
//Creep管理
creepManager.creepManager();
//长夜将至,我从今开始守望
watcher.beginWatch();
//清理内存
tools.cleanMemory();
const result = Game.cpu.generatePixel();
//logger.info(Game.market.changeOrderPrice('5f316d477e0cdd524ac85843', 0.99))
//Game.market.cancelOrder('5f1fc4e464b6561cae9fb6a5');
logger.info("---------------------------------------------- 游戏时间: " + Game.time + " | 所用CPU: " + Game.cpu.getUsed().toFixed(2) + "----------------------------------------------")
}