feat: add LDPlayer_id property and improve emulator stop logic

This commit is contained in:
2026-07-06 22:40:38 +08:00
parent 194043a892
commit abdaa277f8
2 changed files with 45 additions and 26 deletions
+17
View File
@@ -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