diff --git a/clashroyalebuildabot/constants.py b/clashroyalebuildabot/constants.py index b6b5fa8..7a128fa 100644 --- a/clashroyalebuildabot/constants.py +++ b/clashroyalebuildabot/constants.py @@ -174,38 +174,103 @@ ] # Units + DETECTOR_UNITS = [ Units.ARCHER, + Units.ARCHER_QUEEN, + Units.BALLOON, + Units.BANDIT, Units.BARBARIAN, Units.BARBARIAN_HUT, + Units.BAT, + Units.BATTLE_HEALER, + Units.BATTLE_RAM, Units.BOMB_TOWER, Units.BOMBER, + Units.BOWLER, Units.BRAWLER, Units.CANNON, + Units.CANNON_CART, Units.DARK_PRINCE, + Units.DART_GOBLIN, + Units.ELECTRO_DRAGON, + Units.ELECTRO_GIANT, + Units.ELECTRO_SPIRIT, + Units.ELECTRO_WIZARD, + Units.ELITE_BARBARIAN, Units.ELIXIR_COLLECTOR, + Units.ELIXIR_GOLEM_LARGE, + Units.ELIXIR_GOLEM_MEDIUM, + Units.ELIXIR_GOLEM_SMALL, + Units.EXECUTIONER, + Units.FIRE_SPIRIT, + Units.FIRE_CRACKER, + Units.FISHERMAN, + Units.FLYING_MACHINE, Units.FURNACE, Units.GIANT, + Units.GIANT_SKELETON, + Units.GIANT_SNOWBALL, Units.GOBLIN, Units.GOBLIN_CAGE, + Units.GOBLIN_DRILL, Units.GOBLIN_HUT, + Units.GOLDEN_KNIGHT, + Units.GOLEM, + Units.GOLEMITE, + Units.GUARD, + Units.HEAL_SPIRIT, + Units.HOG, + Units.HOG_RIDER, Units.HUNGRY_DRAGON, Units.HUNTER, Units.ICE_GOLEM, Units.ICE_SPIRIT, + Units.ICE_WIZARD, + Units.INFERNO_DRAGON, Units.INFERNO_TOWER, Units.KNIGHT, + Units.LAVA_HOUND, + Units.LAVA_PUP, + Units.LITTLE_PRINCE, + Units.LUMBERJACK, + Units.MAGIC_ARCHER, + Units.MEGA_KNIGHT, + Units.MEGA_MINION, + Units.MIGHTY_MINER, + Units.MINER, Units.MINION, Units.MINIPEKKA, + Units.MONK, Units.MORTAR, + Units.MOTHER_WITCH, Units.MUSKETEER, + Units.NIGHT_WITCH, + Units.PEKKA, + Units.PHOENIX_EGG, + Units.PHOENIX_LARGE, + Units.PHOENIX_SMALL, Units.PRINCE, + Units.PRINCESS, + Units.RAM_RIDER, + Units.RASCAL_BOY, + Units.RASCAL_GIRL, + Units.ROYAL_GHOST, + Units.ROYAL_GIANT, + Units.ROYAL_GUARDIAN, Units.ROYAL_HOG, + Units.ROYAL_RECRUIT, Units.SKELETON, + Units.SKELETON_DRAGON, + Units.SKELETON_KING, + Units.SPARKY, Units.SPEAR_GOBLIN, Units.TESLA, Units.TOMBSTONE, Units.VALKYRIE, Units.WALL_BREAKER, + Units.WITCH, + Units.WIZARD, Units.X_BOW, + Units.ZAPPY, ] diff --git a/clashroyalebuildabot/models/units_M_480x352.onnx b/clashroyalebuildabot/models/units_M_480x352.onnx index 4131383..068d106 100644 Binary files a/clashroyalebuildabot/models/units_M_480x352.onnx and b/clashroyalebuildabot/models/units_M_480x352.onnx differ diff --git a/clashroyalebuildabot/namespaces/cards.py b/clashroyalebuildabot/namespaces/cards.py index 37b9afe..d665beb 100644 --- a/clashroyalebuildabot/namespaces/cards.py +++ b/clashroyalebuildabot/namespaces/cards.py @@ -19,11 +19,11 @@ def __hash__(self): @dataclass(frozen=True) class _CardsNamespace: - ARCHER_QUEEN: Card = Card("archer_queen", False, 5) + ARCHER_QUEEN: Card = Card("archer_queen", False, 5, [Units.ARCHER_QUEEN]) ARCHERS: Card = Card("archers", False, 3, [Units.ARCHER]) ARROWS: Card = Card("arrows", True, 3) - BALLOON: Card = Card("balloon", False, 5) - BANDIT: Card = Card("bandit", False, 3) + BALLOON: Card = Card("balloon", False, 5, [Units.BALLOON]) + BANDIT: Card = Card("bandit", False, 3, [Units.BANDIT]) BARBARIAN_BARREL: Card = Card( "barbarian_barrel", True, 2, [Units.BARBARIAN] ) @@ -31,109 +31,164 @@ class _CardsNamespace: "barbarian_hut", False, 7, [Units.BARBARIAN_HUT, Units.BARBARIAN] ) BARBARIANS: Card = Card("barbarians", False, 5, [Units.BARBARIAN]) - BATS: Card = Card("bats", False, 2) - BATTLE_HEALER: Card = Card("battle_healer", False, 4) - BATTLE_RAM: Card = Card("battle_ram", False, 4) + BATS: Card = Card("bats", False, 2, [Units.BAT]) + BATTLE_HEALER: Card = Card( + "battle_healer", False, 4, [Units.BATTLE_HEALER] + ) + BATTLE_RAM: Card = Card("battle_ram", False, 4, [Units.BATTLE_RAM]) BLANK: Card = Card("blank", False, 11) BOMBER: Card = Card("bomber", False, 2, [Units.BOMBER]) BOMB_TOWER: Card = Card("bomb_tower", False, 4, [Units.BOMB_TOWER]) - BOWLER: Card = Card("bowler", False, 5) + BOWLER: Card = Card("bowler", False, 5, [Units.BOWLER]) CANNON: Card = Card("cannon", False, 3, [Units.CANNON]) - CANNON_CART: Card = Card("cannon_cart", False, 5) + CANNON_CART: Card = Card("cannon_cart", False, 5, [Units.CANNON_CART]) CLONE: Card = Card("clone", True, 3) - DART_GOBLIN: Card = Card("dart_goblin", False, 3) + DART_GOBLIN: Card = Card("dart_goblin", False, 3, [Units.DART_GOBLIN]) DARK_PRINCE: Card = Card("dark_prince", False, 4, [Units.DARK_PRINCE]) EARTHQUAKE: Card = Card("earthquake", True, 3) - ELECTRO_DRAGON: Card = Card("electro_dragon", False, 5) - ELECTRO_GIANT: Card = Card("electro_giant", False, 7) - ELECTRO_SPIRIT: Card = Card("electro_spirit", False, 1) - ELECTRO_WIZARD: Card = Card("electro_wizard", False, 4) - ELITE_BARBARIANS: Card = Card("elite_barbarians", False, 6) + ELECTRO_DRAGON: Card = Card( + "electro_dragon", False, 5, [Units.ELECTRO_DRAGON] + ) + ELECTRO_GIANT: Card = Card( + "electro_giant", False, 7, [Units.ELECTRO_GIANT] + ) + ELECTRO_SPIRIT: Card = Card( + "electro_spirit", False, 1, [Units.ELECTRO_SPIRIT] + ) + ELECTRO_WIZARD: Card = Card( + "electro_wizard", False, 4, [Units.ELECTRO_WIZARD] + ) + ELITE_BARBARIANS: Card = Card( + "elite_barbarians", False, 6, [Units.ELITE_BARBARIAN] + ) ELIXIR_COLLECTOR: Card = Card( "elixir_collector", False, 6, [Units.ELIXIR_COLLECTOR] ) - ELIXIR_GOLEM: Card = Card("elixir_golem", False, 3) - EXECUTIONER: Card = Card("executioner", False, 5) - FIRE_SPIRIT: Card = Card("fire_spirit", False, 1) + ELIXIR_GOLEM: Card = Card( + "elixir_golem", + False, + 3, + [ + Units.ELIXIR_GOLEM_LARGE, + Units.ELIXIR_GOLEM_MEDIUM, + Units.ELIXIR_GOLEM_SMALL, + ], + ) + EXECUTIONER: Card = Card("executioner", False, 5, [Units.EXECUTIONER]) + FIRE_SPIRIT: Card = Card("fire_spirit", False, 1, [Units.FIRE_SPIRIT]) FIREBALL: Card = Card("fireball", True, 4) - FIRECRACKER: Card = Card("firecracker", False, 3) - FISHERMAN: Card = Card("fisherman", False, 3) - FLYING_MACHINE: Card = Card("flying_machine", False, 4) + FIRECRACKER: Card = Card("firecracker", False, 3, [Units.FIRE_CRACKER]) + FISHERMAN: Card = Card("fisherman", False, 3, [Units.FISHERMAN]) + FLYING_MACHINE: Card = Card( + "flying_machine", False, 4, [Units.FLYING_MACHINE] + ) FREEZE: Card = Card("freeze", True, 4) FURNACE: Card = Card("furnace", False, 4, [Units.FURNACE]) GIANT: Card = Card("giant", False, 5, [Units.GIANT]) - GIANT_SKELETON: Card = Card("giant_skeleton", False, 6) + GIANT_SKELETON: Card = Card( + "giant_skeleton", False, 6, [Units.GIANT_SKELETON] + ) GIANT_SNOWBALL: Card = Card("giant_snowball", True, 2) GOBLINS: Card = Card("goblins", False, 2, [Units.GOBLIN]) GOBLIN_BARREL: Card = Card("goblin_barrel", True, 3, [Units.GOBLIN]) GOBLIN_CAGE: Card = Card( "goblin_cage", False, 4, [Units.GOBLIN_CAGE, Units.BRAWLER] ) - GOBLIN_DRILL: Card = Card("goblin_drill", True, 4) + GOBLIN_DRILL: Card = Card( + "goblin_drill", True, 4, [Units.GOBLIN_DRILL, Units.GOBLIN] + ) GOBLIN_GANG: Card = Card( "goblin_gang", False, 3, [Units.GOBLIN, Units.SPEAR_GOBLIN] ) - GOBLIN_GIANT: Card = Card("goblin_giant", False, 6) + GOBLIN_GIANT: Card = Card("goblin_giant", False, 6, [Units.SPEAR_GOBLIN]) GOBLIN_HUT: Card = Card( "goblin_hut", False, 5, [Units.GOBLIN_HUT, Units.SPEAR_GOBLIN] ) - GOLDEN_KNIGHT: Card = Card("golden_knight", False, 4) - GOLEM: Card = Card("golem", False, 8) - GRAVEYARD: Card = Card("graveyard", True, 5) - GUARDS: Card = Card("guards", False, 3) - HEAL_SPIRIT: Card = Card("heal_spirit", False, 1) - HOG_RIDER: Card = Card("hog_rider", False, 4) + GOLDEN_KNIGHT: Card = Card( + "golden_knight", False, 4, [Units.GOLDEN_KNIGHT] + ) + GOLEM: Card = Card("golem", False, 8, [Units.GOLEM, Units.GOLEMITE]) + GRAVEYARD: Card = Card("graveyard", True, 5, [Units.SKELETON]) + GUARDS: Card = Card("guards", False, 3, [Units.GUARD]) + HEAL_SPIRIT: Card = Card("heal_spirit", False, 1, [Units.HEAL_SPIRIT]) + HOG_RIDER: Card = Card("hog_rider", False, 4, [Units.HOG_RIDER]) HUNGRY_DRAGON: Card = Card( "hungry_dragon", False, 4, [Units.HUNGRY_DRAGON] ) HUNTER: Card = Card("hunter", False, 4, [Units.HUNTER]) ICE_GOLEM: Card = Card("ice_golem", False, 2, [Units.ICE_GOLEM]) ICE_SPIRIT: Card = Card("ice_spirit", False, 1, [Units.ICE_SPIRIT]) - ICE_WIZARD: Card = Card("ice_wizard", False, 3) - INFERNO_DRAGON: Card = Card("inferno_dragon", False, 4) + ICE_WIZARD: Card = Card("ice_wizard", False, 3, [Units.ICE_WIZARD]) + INFERNO_DRAGON: Card = Card( + "inferno_dragon", False, 4, [Units.INFERNO_DRAGON] + ) INFERNO_TOWER: Card = Card( "inferno_tower", False, 5, [Units.INFERNO_TOWER] ) KNIGHT: Card = Card("knight", False, 3, [Units.KNIGHT]) - LAVA_HOUND: Card = Card("lava_hound", False, 7) + LAVA_HOUND: Card = Card( + "lava_hound", False, 7, [Units.LAVA_HOUND, Units.LAVA_PUP] + ) LIGHTNING: Card = Card("lightning", True, 6) - LUMBERJACK: Card = Card("lumberjack", False, 4) - MAGIC_ARCHER: Card = Card("magic_archer", False, 4) - MEGA_KNIGHT: Card = Card("mega_knight", False, 7) - MEGA_MINION: Card = Card("mega_minion", False, 3) - MIGHTY_MINER: Card = Card("mighty_miner", False, 4) - MINER: Card = Card("miner", False, 3) + LITTLE_PRINCE: Card = Card( + "little_prince", False, 3, [Units.LITTLE_PRINCE, Units.ROYAL_GUARDIAN] + ) + LUMBERJACK: Card = Card("lumberjack", False, 4, [Units.LUMBERJACK]) + MAGIC_ARCHER: Card = Card("magic_archer", False, 4, [Units.MAGIC_ARCHER]) + MEGA_KNIGHT: Card = Card("mega_knight", False, 7, [Units.MEGA_KNIGHT]) + MEGA_MINION: Card = Card("mega_minion", False, 3, [Units.MEGA_MINION]) + MIGHTY_MINER: Card = Card("mighty_miner", False, 4, [Units.MIGHTY_MINER]) + MINER: Card = Card("miner", False, 3, [Units.MINER]) MINIONS: Card = Card("minions", False, 3, [Units.MINION]) MINION_HORDE: Card = Card("minion_horde", False, 5, [Units.MINION]) MINIPEKKA: Card = Card("minipekka", False, 4, [Units.MINIPEKKA]) MIRROR: Card = Card("mirror", True, -1) - MONK: Card = Card("monk", False, 5) + MONK: Card = Card("monk", False, 5, [Units.MONK]) MORTAR: Card = Card("mortar", False, 4, [Units.MORTAR]) - MOTHER_WITCH: Card = Card("mother_witch", False, 4) + MOTHER_WITCH: Card = Card( + "mother_witch", False, 4, [Units.MOTHER_WITCH, Units.HOG] + ) MUSKETEER: Card = Card("musketeer", False, 4, [Units.MUSKETEER]) - NIGHT_WITCH: Card = Card("night_witch", False, 4) - PEKKA: Card = Card("pekka", False, 7) - PHOENIX: Card = Card("phoenix", False, 4) + NIGHT_WITCH: Card = Card( + "night_witch", False, 4, [Units.NIGHT_WITCH, Units.BAT] + ) + PEKKA: Card = Card("pekka", False, 7, [Units.PEKKA]) + PHOENIX: Card = Card( + "phoenix", + False, + 4, + [Units.PHOENIX_LARGE, Units.PHOENIX_EGG, Units.PHOENIX_SMALL], + ) POISON: Card = Card("poison", True, 4) PRINCE: Card = Card("prince", False, 5, [Units.PRINCE]) - PRINCESS: Card = Card("princess", False, 3) + PRINCESS: Card = Card("princess", False, 3, [Units.PRINCESS]) RAGE: Card = Card("rage", True, 2) - RAM_RIDER: Card = Card("ram_rider", False, 5) - RASCALS: Card = Card("rascals", False, 5) + RAM_RIDER: Card = Card("ram_rider", False, 5, [Units.RAM_RIDER]) + RASCALS: Card = Card( + "rascals", False, 5, [Units.RASCAL_BOY, Units.RASCAL_GIRL] + ) ROCKET: Card = Card("rocket", True, 6) - ROYAL_DELIVERY: Card = Card("royal_delivery", False, 3) - ROYAL_GHOST: Card = Card("royal_ghost", False, 3) - ROYAL_GIANT: Card = Card("royal_giant", False, 6) + ROYAL_DELIVERY: Card = Card( + "royal_delivery", False, 3, [Units.ROYAL_RECRUIT] + ) + ROYAL_GHOST: Card = Card("royal_ghost", False, 3, [Units.ROYAL_GHOST]) + ROYAL_GIANT: Card = Card("royal_giant", False, 6, [Units.ROYAL_GIANT]) ROYAL_HOGS: Card = Card("royal_hogs", False, 5, [Units.ROYAL_HOG]) - ROYAL_RECRUITS: Card = Card("royal_recruits", False, 7) + ROYAL_RECRUITS: Card = Card( + "royal_recruits", False, 7, [Units.ROYAL_RECRUIT] + ) SKELETONS: Card = Card("skeletons", False, 1, [Units.SKELETON]) SKELETON_ARMY: Card = Card("skeleton_army", False, 3, [Units.SKELETON]) - SKELETON_BARREL: Card = Card("skeleton_barrel", False, 3) - SKELETON_DRAGONS: Card = Card("skeleton_dragons", False, 4) - SKELETON_KING: Card = Card("skeleton_king", False, 4) - SPARKY: Card = Card("sparky", False, 6) + SKELETON_BARREL: Card = Card("skeleton_barrel", False, 3, [Units.SKELETON]) + SKELETON_DRAGONS: Card = Card( + "skeleton_dragons", False, 4, [Units.SKELETON_DRAGON] + ) + SKELETON_KING: Card = Card( + "skeleton_king", False, 4, [Units.SKELETON_KING, Units.SKELETON] + ) + SPARKY: Card = Card("sparky", False, 6, [Units.SPARKY]) SPEAR_GOBLINS: Card = Card("spear_goblins", False, 2, [Units.SPEAR_GOBLIN]) - TESLA: Card = Card("tesla", False, 4) + TESLA: Card = Card("tesla", False, 4, [Units.TESLA]) THE_LOG: Card = Card("the_log", True, 2) THREE_MUSKETEERS: Card = Card( "three_musketeers", False, 9, [Units.MUSKETEER] @@ -142,11 +197,11 @@ class _CardsNamespace: TORNADO: Card = Card("tornado", True, 3) VALKYRIE: Card = Card("valkyrie", False, 4, [Units.VALKYRIE]) WALL_BREAKERS: Card = Card("wall_breakers", False, 2, [Units.WALL_BREAKER]) - WITCH: Card = Card("witch", False, 5) - WIZARD: Card = Card("wizard", False, 5) + WITCH: Card = Card("witch", False, 5, [Units.WITCH, Units.SKELETON]) + WIZARD: Card = Card("wizard", False, 5, [Units.WIZARD]) X_BOW: Card = Card("x_bow", False, 6, [Units.X_BOW]) ZAP: Card = Card("zap", True, 2) - ZAPPIES: Card = Card("zappies", False, 4) + ZAPPIES: Card = Card("zappies", False, 4, [Units.ZAPPY]) Cards = _CardsNamespace() diff --git a/clashroyalebuildabot/namespaces/units.py b/clashroyalebuildabot/namespaces/units.py index 4668026..a170c9d 100644 --- a/clashroyalebuildabot/namespaces/units.py +++ b/clashroyalebuildabot/namespaces/units.py @@ -3,6 +3,12 @@ from typing import Literal, Optional, Tuple +@dataclass(frozen=True) +class UnitCategory: + TROOP: str = "troop" + BUILDING: str = "building" + + @dataclass(frozen=True) class Target: AIR: str = "air" @@ -20,10 +26,8 @@ class Transport: @dataclass(frozen=True) class Unit: name: str - category: Literal["troop", "spell", "building"] - target: Optional[ - Literal[Target.AIR, Target.GROUND, Target.BUILDINGS, Target.ALL] - ] + category: Literal[UnitCategory.TROOP, UnitCategory.BUILDING] + target: Optional[Literal[Target.GROUND, Target.BUILDINGS, Target.ALL]] transport: Optional[Literal[Transport.AIR, Transport.GROUND]] @@ -43,39 +47,300 @@ class UnitDetection: @dataclass(frozen=True) class _UnitsNamespace: - ARCHER: Unit = Unit("archer", "troop", "both", "ground") - BARBARIAN: Unit = Unit("barbarian", "troop", "ground", "ground") - BARBARIAN_HUT: Unit = Unit("barbarian_hut", "building", None, None) - BOMBER: Unit = Unit("bomber", "troop", "ground", "ground") - BOMB_TOWER: Unit = Unit("bomb_tower", "building", "ground", "ground") - BRAWLER: Unit = Unit("brawler", "troop", "ground", "ground") - CANNON: Unit = Unit("cannon", "building", "ground", "ground") - DARK_PRINCE: Unit = Unit("dark_prince", "troop", "ground", "ground") - ELIXIR_COLLECTOR: Unit = Unit("elixir_collector", "building", None, None) - FURNACE: Unit = Unit("furnace", "building", None, None) - GIANT: Unit = Unit("giant", "troop", "ground", "ground") - GOBLIN: Unit = Unit("goblin", "troop", "ground", "ground") - GOBLIN_CAGE: Unit = Unit("goblin_cage", "building", None, None) - GOBLIN_HUT: Unit = Unit("goblin_hut", "building", None, None) - HUNGRY_DRAGON: Unit = Unit("hungry_dragon", "troop", "all", "air") - HUNTER: Unit = Unit("hunter", "troop", "all", "ground") - ICE_GOLEM: Unit = Unit("ice_golem", "troop", "buildings", "ground") - ICE_SPIRIT: Unit = Unit("ice_spirit", "troop", "all", "ground") - INFERNO_TOWER: Unit = Unit("inferno_tower", "building", None, None) - KNIGHT: Unit = Unit("knight", "troop", "ground", "ground") - MINION: Unit = Unit("minion", "troop", "both", "air") - MINIPEKKA: Unit = Unit("minipekka", "troop", "ground", "ground") - MORTAR: Unit = Unit("mortar", "building", "ground", "ground") - MUSKETEER: Unit = Unit("musketeer", "troop", "both", "ground") - PRINCE: Unit = Unit("prince", "troop", "ground", "ground") - ROYAL_HOG: Unit = Unit("royal_hog", "troop", "buildings", "ground") - SKELETON: Unit = Unit("skeleton", "troop", "ground", "ground") - SPEAR_GOBLIN: Unit = Unit("spear_goblin", "troop", "both", "ground") - TESLA: Unit = Unit("tesla", "building", "both", "ground") - TOMBSTONE: Unit = Unit("tombstone", "building", None, None) - VALKYRIE: Unit = Unit("valkyrie", "troop", "ground", "ground") - WALL_BREAKER: Unit = Unit("wall_breaker", "troop", "buildings", "ground") - X_BOW: Unit = Unit("x_bow", "building", "ground", "ground") + ARCHER: Unit = Unit( + "archer", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ARCHER_QUEEN: Unit = Unit( + "archer_queen", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + BALLOON: Unit = Unit( + "balloon", UnitCategory.TROOP, Target.BUILDINGS, Transport.AIR + ) + BANDIT: Unit = Unit( + "bandit", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + BARBARIAN: Unit = Unit( + "barbarian", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + BARBARIAN_HUT: Unit = Unit( + "barbarian_hut", UnitCategory.BUILDING, None, None + ) + BAT: Unit = Unit("bat", UnitCategory.TROOP, Target.ALL, Transport.AIR) + BATTLE_HEALER: Unit = Unit( + "battle_healer", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + BATTLE_RAM: Unit = Unit( + "battle_ram", + UnitCategory.TROOP, + UnitCategory.BUILDING, + Transport.GROUND, + ) + BOMB_TOWER: Unit = Unit( + "bomb_tower", UnitCategory.BUILDING, Target.GROUND, Transport.GROUND + ) + BOMBER: Unit = Unit( + "bomber", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + BOWLER: Unit = Unit( + "bowler", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + BRAWLER: Unit = Unit( + "brawler", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + CANNON: Unit = Unit( + "cannon", UnitCategory.BUILDING, Target.GROUND, Transport.GROUND + ) + CANNON_CART: Unit = Unit( + "cannon_cart", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + DARK_PRINCE: Unit = Unit( + "dark_prince", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + DART_GOBLIN: Unit = Unit( + "dart_goblin", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ELECTRO_DRAGON: Unit = Unit( + "electro_dragon", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + ELECTRO_GIANT: Unit = Unit( + "electro_giant", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + ELECTRO_SPIRIT: Unit = Unit( + "electro_spirit", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ELECTRO_WIZARD: Unit = Unit( + "electro_wizard", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ELITE_BARBARIAN: Unit = Unit( + "elite_barbarian", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + ELIXIR_COLLECTOR: Unit = Unit( + "elixir_collector", UnitCategory.BUILDING, None, None + ) + ELIXIR_GOLEM_LARGE: Unit = Unit( + "elixir_golem_large", + UnitCategory.TROOP, + Target.BUILDINGS, + Transport.GROUND, + ) + ELIXIR_GOLEM_MEDIUM: Unit = Unit( + "elixir_golem_medium", + UnitCategory.TROOP, + Target.BUILDINGS, + Transport.GROUND, + ) + ELIXIR_GOLEM_SMALL: Unit = Unit( + "elixir_golem_small", + UnitCategory.TROOP, + Target.BUILDINGS, + Transport.GROUND, + ) + EXECUTIONER: Unit = Unit( + "executioner", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + FIRE_SPIRIT: Unit = Unit( + "fire_spirit", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + FIRE_CRACKER: Unit = Unit( + "firecracker", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + FISHERMAN: Unit = Unit( + "fisherman", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + FLYING_MACHINE: Unit = Unit( + "flying_machine", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + FURNACE: Unit = Unit("furnace", UnitCategory.BUILDING, None, None) + GIANT: Unit = Unit( + "giant", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + GIANT_SKELETON: Unit = Unit( + "giant_skeleton", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + # This is mistake, remove the snowball next time we train the object detector + GIANT_SNOWBALL: Unit = Unit( + "giant_snowball", UnitCategory.TROOP, None, None + ) + GOBLIN: Unit = Unit( + "goblin", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + GOBLIN_CAGE: Unit = Unit("goblin_cage", UnitCategory.BUILDING, None, None) + GOBLIN_DRILL: Unit = Unit( + "goblin_drill", UnitCategory.BUILDING, Target.GROUND, None + ) + GOBLIN_HUT: Unit = Unit("goblin_hut", UnitCategory.BUILDING, None, None) + GOLDEN_KNIGHT: Unit = Unit( + "golden_knight", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + GOLEM: Unit = Unit( + "golem", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + GOLEMITE: Unit = Unit( + "golemite", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + GUARD: Unit = Unit( + "guard", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + HEAL_SPIRIT: Unit = Unit( + "heal_spirit", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + HOG: Unit = Unit( + "hog", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + HOG_RIDER: Unit = Unit( + "hog_rider", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + HUNGRY_DRAGON: Unit = Unit( + "hungry_dragon", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + HUNTER: Unit = Unit( + "hunter", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ICE_GOLEM: Unit = Unit( + "ice_golem", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + ICE_SPIRIT: Unit = Unit( + "ice_spirit", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ICE_WIZARD: Unit = Unit( + "ice_wizard", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + INFERNO_DRAGON: Unit = Unit( + "inferno_dragon", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + INFERNO_TOWER: Unit = Unit( + "inferno_tower", UnitCategory.BUILDING, None, None + ) + KNIGHT: Unit = Unit( + "knight", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + LAVA_HOUND: Unit = Unit( + "lava_hound", UnitCategory.TROOP, Target.BUILDINGS, Transport.AIR + ) + LAVA_PUP: Unit = Unit( + "lava_pup", UnitCategory.TROOP, Target.BUILDINGS, Transport.AIR + ) + LITTLE_PRINCE: Unit = Unit( + "little_prince", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + LUMBERJACK: Unit = Unit( + "lumberjack", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MAGIC_ARCHER: Unit = Unit( + "magic_archer", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + MEGA_KNIGHT: Unit = Unit( + "mega_knight", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MEGA_MINION: Unit = Unit( + "mega_minion", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + MIGHTY_MINER: Unit = Unit( + "mighty_miner", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MINER: Unit = Unit( + "miner", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MINION: Unit = Unit( + "minion", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + MINIPEKKA: Unit = Unit( + "minipekka", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MONK: Unit = Unit( + "monk", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + MORTAR: Unit = Unit( + "mortar", UnitCategory.BUILDING, Target.GROUND, Transport.GROUND + ) + MOTHER_WITCH: Unit = Unit( + "mother_witch", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + MUSKETEER: Unit = Unit( + "musketeer", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + NIGHT_WITCH: Unit = Unit( + "night_witch", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + PEKKA: Unit = Unit( + "pekka", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + PHOENIX_EGG: Unit = Unit( + "phoenix_egg", UnitCategory.TROOP, None, Transport.GROUND + ) + PHOENIX_LARGE: Unit = Unit( + "phoenix_large", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + PHOENIX_SMALL: Unit = Unit( + "phoenix_small", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + PRINCE: Unit = Unit( + "prince", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + PRINCESS: Unit = Unit( + "princess", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + RAM_RIDER: Unit = Unit( + "ram_rider", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + RASCAL_BOY: Unit = Unit( + "rascal_boy", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + RASCAL_GIRL: Unit = Unit( + "rascal_girl", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + ROYAL_GHOST: Unit = Unit( + "royal_ghost", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + ROYAL_GIANT: Unit = Unit( + "royal_giant", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + ROYAL_GUARDIAN: Unit = Unit( + "royal_guardian", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + ROYAL_HOG: Unit = Unit( + "royal_hog", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + ROYAL_RECRUIT: Unit = Unit( + "royal_recruit", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + SKELETON: Unit = Unit( + "skeleton", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + SKELETON_DRAGON: Unit = Unit( + "skeleton_dragon", UnitCategory.TROOP, Target.ALL, Transport.AIR + ) + SKELETON_KING: Unit = Unit( + "skeleton_king", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + SPARKY: Unit = Unit( + "sparky", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + SPEAR_GOBLIN: Unit = Unit( + "spear_goblin", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + TESLA: Unit = Unit( + "tesla", UnitCategory.BUILDING, Target.ALL, Transport.GROUND + ) + TOMBSTONE: Unit = Unit("tombstone", UnitCategory.BUILDING, None, None) + VALKYRIE: Unit = Unit( + "valkyrie", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) + WALL_BREAKER: Unit = Unit( + "wall_breaker", UnitCategory.TROOP, Target.BUILDINGS, Transport.GROUND + ) + WITCH: Unit = Unit( + "witch", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + WIZARD: Unit = Unit( + "wizard", UnitCategory.TROOP, Target.ALL, Transport.GROUND + ) + X_BOW: Unit = Unit( + "x_bow", UnitCategory.BUILDING, Target.GROUND, Transport.GROUND + ) + ZAPPY: Unit = Unit( + "zappy", UnitCategory.TROOP, Target.GROUND, Transport.GROUND + ) Units = _UnitsNamespace()