mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-15 17:02:12 +00:00
feat: add LDPlayer_id property and improve emulator stop logic
This commit is contained in:
@@ -114,6 +114,23 @@ class EmulatorInstanceBase:
|
||||
|
||||
return None
|
||||
|
||||
@cached_property
|
||||
def LDPlayer_id(self):
|
||||
"""
|
||||
Convert LDPlayer instance name to instance id.
|
||||
Example names:
|
||||
leidian0
|
||||
leidian1
|
||||
|
||||
Returns:
|
||||
int: Instance ID, or None if this is not a LDPlayer instance
|
||||
"""
|
||||
res = re.search(r'leidian(\d+)', self.name)
|
||||
if res:
|
||||
return int(res.group(1))
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class EmulatorBase:
|
||||
# Values here must match those in argument.yaml EmulatorInfo.Emulator.option
|
||||
|
||||
Reference in New Issue
Block a user