示例#1
0
 def clone(self, other, exclude=set(), extra={}):
     # copyable values
     reverse = []
     copyable = set(["name", "cost", "text", "abilities", "color", "supertypes", "subtypes", "types", "base_power", "base_toughness", "base_loyalty"])
     for name in copyable-exclude:
         obj = getattr(self, name)
         extra_copyable = extra.get(name, None)
         reverse.append(obj.set_copy(getattr(other, name).copyable, extra_copyable))
     return combine(*reverse)
示例#2
0
 def clone(self, other, exclude=set(), extra={}):
     # Allow "lazy" exclusion: typing exclude="color" or exclude="name" or even exclude=("color", "name") will still result in the needed set.
     if not isinstance(exclude, set):
         if not isinstance(exclude, (list, tuple)):
             exclude = (exclude,)
         exclude = set(exclude)
     # copyable values
     reverse = []
     copyable = set(["name", "cost", "text", "abilities", "color", "supertypes", "subtypes", "types", "base_power", "base_toughness", "base_loyalty"])
     for name in copyable-exclude:
         obj = getattr(self, name)
         extra_copyable = extra.get(name, None)
         reverse.append(obj.set_copy(getattr(other, name).copyable, extra_copyable))
     return combine(*reverse)
示例#3
0
 def cda_power_toughness(self, power, toughness):
     expire = []
     if power: expire.append(self.base_power.cda(power))
     if toughness: expire.append(self.base_toughness.cda(toughness))
     return combine(*expire)