コード例 #1
0
ファイル: test_obj.py プロジェクト: pmachata/unnamable
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)
コード例 #2
0
ファイル: instances.py プロジェクト: pmachata/unnamable
 def __init__(self, proto):
     Subject.__init__(self, proto)
     self.m_exhausted = False
コード例 #3
0
ファイル: instances.py プロジェクト: pmachata/unnamable
 def __init__ (self, proto):
     Subject.__init__ (self, proto)
     self.m_exhausted = False
コード例 #4
0
ファイル: instances.py プロジェクト: pmachata/unnamable
 def __init__(self, proto):
     ObjectWithLocation.__init__(self, None)
     Subject.__init__(self, proto)
     self.m_combat_check = None
コード例 #5
0
ファイル: instances.py プロジェクト: pmachata/unnamable
 def __init__ (self, proto):
     ObjectWithLocation.__init__ (self, None)
     Subject.__init__ (self, proto)
     self.m_combat_check = None