Skip to content

Commit

Permalink
简化solvers导入
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Jul 27, 2024
1 parent bf42312 commit a362bde
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 21 deletions.
5 changes: 2 additions & 3 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from evalidate import Expr

from arknights_mower import __version__
from arknights_mower.solvers.reclamation_algorithm import ReclamationAlgorithm
from arknights_mower.solvers.secret_front import SecretFront
from arknights_mower.solvers import ReclamationAlgorithm, SecretFront
from arknights_mower.utils import config, path, rapidocr
from arknights_mower.utils.csleep import MowerExit
from arknights_mower.utils.datetime import format_time
Expand Down Expand Up @@ -43,7 +42,7 @@ def initialize(tasks, scheduler=None):
if scheduler is not None:
scheduler.handle_error(True)
return scheduler
from arknights_mower.solvers.base_schedule import BaseSchedulerSolver
from arknights_mower.solvers import BaseSchedulerSolver

base_scheduler = BaseSchedulerSolver()
base_scheduler.operators = {}
Expand Down
35 changes: 35 additions & 0 deletions arknights_mower/solvers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from .auto_fight import AutoFight
from .base_schedule import BaseSchedulerSolver
from .credit import CreditSolver
from .credit_fight import CreditFight
from .cultivate_depot import cultivate as cultivateDepotSolver
from .depotREC import depotREC as DepotSolver
from .mail import MailSolver
from .mission import MissionSolver
from .navigation import NavigationSolver
from .operation import OperationSolver
from .reclamation_algorithm import ReclamationAlgorithm
from .recruit import RecruitSolver
from .report import ReportSolver
from .secret_front import SecretFront
from .shop import CreditShop
from .skland import SKLand

__all__ = [
"AutoFight",
"BaseSchedulerSolver",
"CreditSolver",
"CreditFight",
"cultivateDepotSolver",
"DepotSolver",
"MailSolver",
"MissionSolver",
"NavigationSolver",
"OperationSolver",
"ReclamationAlgorithm",
"RecruitSolver",
"ReportSolver",
"SecretFront",
"CreditShop",
"SKLand",
]
32 changes: 17 additions & 15 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@
import cv2

from arknights_mower.data import agent_list, base_room_list
from arknights_mower.solvers.base_mixin import BaseMixin
from arknights_mower.solvers.credit import CreditSolver
from arknights_mower.solvers.credit_fight import CreditFight
from arknights_mower.solvers.cultivate_depot import cultivate as cultivateDepotSolver
from arknights_mower.solvers.depotREC import depotREC as DepotSolver
from arknights_mower.solvers.mail import MailSolver
from arknights_mower.solvers.mission import MissionSolver
from arknights_mower.solvers.navigation import NavigationSolver
from arknights_mower.solvers.operation import OperationSolver
from arknights_mower.solvers.reclamation_algorithm import ReclamationAlgorithm
from arknights_mower.solvers.recruit import RecruitSolver
from arknights_mower.solvers.report import ReportSolver
from arknights_mower.solvers.secret_front import SecretFront
from arknights_mower.solvers.shop import CreditShop
from arknights_mower.solvers.skland import SKLand
from arknights_mower.solvers import (
BaseMixin,
CreditFight,
CreditShop,
CreditSolver,
DepotSolver,
MailSolver,
MissionSolver,
NavigationSolver,
OperationSolver,
ReclamationAlgorithm,
RecruitSolver,
ReportSolver,
SecretFront,
SKLand,
cultivateDepotSolver,
)
from arknights_mower.utils import config, detector, hot_update, rapidocr
from arknights_mower.utils import typealias as tp
from arknights_mower.utils.csleep import MowerExit, csleep
Expand Down
3 changes: 1 addition & 2 deletions arknights_mower/solvers/credit_fight.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import cv2
from scipy.signal import argrelmin

from arknights_mower.solvers.auto_fight import AutoFight
from arknights_mower.solvers.navigation import NavigationSolver
from arknights_mower.solvers import AutoFight, NavigationSolver
from arknights_mower.utils import config
from arknights_mower.utils.graph import SceneGraphSolver
from arknights_mower.utils.image import cropimg, loadres
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_pushplus_push():
@app.route("/check-skland")
@require_token
def test_skland():
from arknights_mower.solvers.skland import SKLand
from arknights_mower.solvers import SKLand

return SKLand().test_connect()

Expand Down

0 comments on commit a362bde

Please sign in to comment.