Exemplo n.º 1
0
from obj import Subject, SubjectProto

class Proto (SubjectProto):
    def __init__ (self):
        SubjectProto.__init__ (self, [1, 2])

proto = Proto ()
obj1 = Subject (proto)
obj2 = Subject (proto)
assert obj1.has_special_ability (1)
assert obj1.has_special_ability (2)
assert obj2.has_special_ability (1)
assert obj2.has_special_ability (2)

obj1.add_special_ability (3)
assert obj1.has_special_ability (3)
assert not obj2.has_special_ability (3)

obj1.remove_special_ability (3)
assert not obj1.has_special_ability (3)

obj1.remove_special_ability (2)
assert not obj1.has_special_ability (2)
assert obj2.has_special_ability (2)

obj1.add_special_ability (3)
assert obj1.has_special_ability (3)
assert not obj1.has_special_ability (2)

obj1.add_special_ability (2)
assert obj1.has_special_ability (2)
Exemplo n.º 2
0
 def __init__(self, proto):
     Subject.__init__(self, proto)
     self.m_exhausted = False
Exemplo n.º 3
0
 def __init__ (self, proto):
     Subject.__init__ (self, proto)
     self.m_exhausted = False
Exemplo n.º 4
0
 def __init__(self, proto):
     ObjectWithLocation.__init__(self, None)
     Subject.__init__(self, proto)
     self.m_combat_check = None
Exemplo n.º 5
0
 def __init__ (self, proto):
     ObjectWithLocation.__init__ (self, None)
     Subject.__init__ (self, proto)
     self.m_combat_check = None