Add apm to score.py
@@ -2,6 +2,7 @@ class ScoreDetails:
""" Accessable in self.state.score during step function
For more information, see https://github.com/Blizzard/s2client-proto/blob/master/s2clientprotocol/score.proto
"""
+
def __init__(self, proto):
self._data = proto
self._proto = proto.score_details
@@ -17,7 +18,8 @@ class ScoreDetails:
for stat in self.state.score.summary:
file.write(f"{stat[0]:<35} {float(stat[1]):>35.3f}\n")
"""
- values = ["score_type",
+ values = [
+ "score_type",
"score",
"idle_production_time",
"idle_worker_time",
@@ -95,6 +97,8 @@ class ScoreDetails:
"total_healed_life",
"total_healed_shields",
"total_healed_energy",
+ "current_apm",
+ "current_effective_apm",
]
return [[value, getattr(self, value)] for value in values]
@@ -409,3 +413,11 @@ class ScoreDetails:
@property
def total_healed_energy(self):
return self._proto.total_healed.energy
+
+ @property
+ def current_apm(self):
+ return self._proto.current_apm
+
+ @property
+ def current_effective_apm(self):
+ return self._proto.current_effective_apm
