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("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("double_confirm/main", x_rate=1)


@edge(Scene.ROGUE_INDEX, Scene.ROGUE_THEME_SELECT)
@edge(Scene.ROGUE_THEME_SELECT, Scene.TERMINAL_REGULAR)
def rogue_back(solver: BaseSolver):
    solver.back()
