mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 17:29:04 +08:00
Chore: [ALAS] Expose one Platform class
This commit is contained in:
parent
a144908e14
commit
71318a3228
@ -1,5 +1,4 @@
|
||||
import collections
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
from module.base.timer import Timer
|
||||
@ -12,11 +11,6 @@ from module.exception import (EmulatorNotRunningError, GameNotRunningError, Game
|
||||
from module.handler.assets import GET_MISSION
|
||||
from module.logger import logger
|
||||
|
||||
if sys.platform == 'win32':
|
||||
from module.device.platform.platform_windows import PlatformWindows as Platform
|
||||
else:
|
||||
from module.device.platform.platform_base import PlatformBase as Platform
|
||||
|
||||
|
||||
def show_function_call():
|
||||
"""
|
||||
@ -58,7 +52,7 @@ def show_function_call():
|
||||
logger.info('Function calls:' + ''.join(func_list))
|
||||
|
||||
|
||||
class Device(Screenshot, Control, AppControl, Platform):
|
||||
class Device(Screenshot, Control, AppControl):
|
||||
_screen_size_checked = False
|
||||
detect_record = set()
|
||||
click_record = collections.deque(maxlen=15)
|
||||
|
||||
6
module/device/platform/__init__.py
Normal file
6
module/device/platform/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.platform == 'win32':
|
||||
from module.device.platform.platform_windows import PlatformWindows as Platform
|
||||
else:
|
||||
from module.device.platform.platform_base import PlatformBase as Platform
|
||||
@ -54,7 +54,7 @@ class EmulatorInstanceBase:
|
||||
Returns:
|
||||
str: Emulator type, such as Emulator.NoxPlayer
|
||||
"""
|
||||
return EmulatorBase.path_to_type(self.path)
|
||||
return self.emulator.type
|
||||
|
||||
@cached_property
|
||||
def emulator(self):
|
||||
|
||||
@ -56,14 +56,6 @@ def abspath(path):
|
||||
|
||||
|
||||
class EmulatorInstance(EmulatorInstanceBase):
|
||||
@cached_property
|
||||
def type(self) -> str:
|
||||
"""
|
||||
Returns:
|
||||
str: Emulator type, such as Emulator.NoxPlayer
|
||||
"""
|
||||
return Emulator.path_to_type(self.path)
|
||||
|
||||
@cached_property
|
||||
def emulator(self):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user