Skip to content

Commit

Permalink
fix life status not reading from info problem (#664)
Browse files Browse the repository at this point in the history
* fix life status not reading from info problem

* add from_hero and unpack one layer from lifestats
  • Loading branch information
xieleo5 committed Dec 13, 2022
1 parent 0351048 commit d2a69c9
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -40,12 +40,16 @@ def to_hero(self, x) -> str:
def __init__(self, hero_keys, univ_keys, space, default_if_missing=None):
self.hero_keys = hero_keys
self.univ_keys = univ_keys
super().__init__(hero_keys=hero_keys, univ_keys=['life_stats'] + univ_keys, space=space,
default_if_missing=default_if_missing)
super().__init__(hero_keys=hero_keys, univ_keys=['life_stats'] + univ_keys,
space=space, default_if_missing=default_if_missing)

def xml_template(self) -> str:
return str("""<ObservationFromFullStats/>""")

def from_hero(self, hero_dict):
hero_dict = hero_dict['life_stats']
return super().from_hero(hero_dict)


class _IsAliveObservation(LifeStatsObservation):
"""
Expand Down

0 comments on commit d2a69c9

Please sign in to comment.