def __init__(self, label, jlv, actions, motions): super(EmpathyScenarioButton, self).__init__(label) self._actions = actions self._motions = [] self._jlv = jlv for motion in motions: motion = EmpathyMotionList.getByName(str(jlv) + "_" + motion) if motion is not None: self._motions.append(motion)
def add(self, jlv, actions = None, motion = None): if not jlv in self._list: self._list[jlv] = [[], []] self._maxLevel = max(self._maxLevel, jlv) #END if if actions is not None: if isinstance(actions, BaseAction): actions = [actions] #END if self._list[jlv][EmpathyRandomButton.INDEX_ACTIONS].append(actions) #END if if motion is not None: motion = EmpathyMotionList.getByName(str(jlv) + "_" + motion) if motion is not None: self._list[jlv][EmpathyRandomButton.INDEX_MOTION].append(motion)