from mower.utils.scene import Scene
from mower.utils.solver import BaseSolver

from .utils import edge


@edge(Scene.UNKNOW_ROGUE, Scene.ROGUE_INDEX)
@edge(Scene.ROGUE_SELECT, Scene.ROGUE_INDEX)
def infra_back(solver: BaseSolver):
    solver.tap_element("rogue/back")


@edge(Scene.ROGUE_ABANDON, Scene.ROGUE_INDEX)
@edge(Scene.ROGUE_REFRESH_SHOP, Scene.UNKNOW_ROGUE)
def double_confirm_back(solver: BaseSolver):
    solver.tap_element("double_confirm/main", x_rate=1)
