From 8e5027ded2be8ba6610de45be54d88193fe4bc86 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 17 Jun 2024 22:45:02 +0100 Subject: [PATCH] pylint fixes --- clashroyalebuildabot/bot/pete/pete_action.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clashroyalebuildabot/bot/pete/pete_action.py b/clashroyalebuildabot/bot/pete/pete_action.py index 2c3c6f6..517c400 100644 --- a/clashroyalebuildabot/bot/pete/pete_action.py +++ b/clashroyalebuildabot/bot/pete/pete_action.py @@ -13,13 +13,13 @@ def _distance(x1, y1, x2, y2): def _calculate_building_score(self, units): score = [0, 0, 0] - n_enemies = sum([len(v) for k, v in units["enemy"].items()]) + n_enemies = sum(len(v) for v in units["enemy"].values()) # Play defensively if the enemy has a unit in our half if n_enemies != 0: rhs = 0 lhs = 0 - for k, v in units["enemy"].items(): + for v in units["enemy"].values(): for unit in v["positions"]: tile_x, tile_y = unit["tile_xy"] if tile_x > 8 and tile_y <= 17: @@ -49,7 +49,7 @@ def _calculate_troop_score(self, units): score = [0.5, 0, 0] # Play aggressively if the enemy has no units - n_enemies = sum([len(v) for k, v in units["enemy"].items()]) + n_enemies = sum(len(v) for k, v in units["enemy"].items()) if self.target == "buildings" and n_enemies == 0: score[0] = 1