from mower.utils import typealias as tp

from .auto_fight import AutoFight
from .battle_choose import BattleChooseSolver


class FightSolver:
    solver_name = "选人并战斗"

    def run(
        self,
        level_name: str = "",
        opers: tp.Opers = [],
        groups: tp.Groups = [],
        actions: list = [],
        squad: int = 0,
    ):
        if not BattleChooseSolver().run(opers, groups, squad):
            return False
        return AutoFight().run(level_name, opers, actions, groups)
