Ejemplo n.º 1
0
 def __from_json__(self, players, picker, condition=None):
     if condition:
         self.condition = hearthbreaker.tags.condition.Condition.from_json(**condition)
     else:
         self.condition = None
     self.players = Player.from_json(players)
     self.picker = Picker.from_json(**picker)
     return self
Ejemplo n.º 2
0
 def __from_json__(self, players, picker, condition=None):
     if condition:
         self.condition = hearthbreaker.tags.condition.Condition.from_json(
             **condition)
     else:
         self.condition = None
     self.players = Player.from_json(players)
     self.picker = Picker.from_json(**picker)
     return self
Ejemplo n.º 3
0
    def __from_json__(self, buffs=None, effects=None, auras=None, picker=None):
        if effects:  # To allow for give to work with effects as well, we check at load time
            return GiveEffect.__new__(GiveEffect).__from_json__(effects)

        if auras:  # To allow for give to work with auras as well, we check at load time
            return GiveAura.__new__(GiveAura).__from_json__(auras)

        self.buffs = []
        for buff in buffs:
            if "until" in buff:
                self.buffs.append(BuffUntil.from_json(**buff))
            else:
                self.buffs.append(Buff.from_json(**buff))

        if not picker:
            self.picker = AllPicker()
        else:
            self.picker = Picker.from_json(**picker)
        return self
Ejemplo n.º 4
0
    def __from_json__(self, buffs=None, effects=None, auras=None, picker=None):
        if effects:  # To allow for give to work with effects as well, we check at load time
            return GiveEffect.__new__(GiveEffect).__from_json__(effects)

        if auras:  # To allow for give to work with auras as well, we check at load time
            return GiveAura.__new__(GiveAura).__from_json__(auras)

        self.buffs = []
        for buff in buffs:
            if "until" in buff:
                self.buffs.append(BuffUntil.from_json(**buff))
            else:
                self.buffs.append(Buff.from_json(**buff))

        if not picker:
            self.picker = AllPicker()
        else:
            self.picker = Picker.from_json(**picker)
        return self
Ejemplo n.º 5
0
 def __from_json__(self, picker, players='friendly'):
     self.players = Player.from_json(players)
     self.picker = Picker.from_json(**picker)
     return self
Ejemplo n.º 6
0
 def __from_json__(self, picker, players='friendly'):
     self.players = Player.from_json(players)
     self.picker = Picker.from_json(**picker)
     return self