📜  获取creepscreeps的数量 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:41.837000             🧑  作者: Mango

代码示例1
var count = Object.keys(Game.creeps).reduce(function(p, c, i, a) {return p + (Game.creeps[c].memory.role == "aRole" ? 1 : 0)}, 0)