scores[path[0]] += self.CalculateScore(unit, target, path)
bestScore = sorted(scores.items(), key = lambda e : e[1], reverse=True)[0]
scores[path[0]] += self.CalculateScore(unit, target, path)
bestScore = sorted(scores.items(), key = lambda e : e[1], reverse=True)[0]
- moveList.append({"unit":unit, "direction":bestScore[0], "score":bestScore[1]})
+ if bestScore[1] > -100.0:
+ moveList.append({"unit":unit, "direction":bestScore[0], "score":bestScore[1]})
+
def CalculateScore(self, attacker, defender, path):
p = move(attacker.x, attacker.y, path[0], 1)
def CalculateScore(self, attacker, defender, path):
p = move(attacker.x, attacker.y, path[0], 1)