def __init__(self, scene, pos = (0, 0, 0), rot = (0, 0, 0)): Object.__init__(self, scene, 'Player',(0, 0, 0), pos, rot) self.speed = 5 self.sensitivity = 100 self.collisionR = 1
def __init__(self, name, path, \ use, var, meth, call, types): # Call mother's init Object.__init__(self, name, path, \ use, var, meth, call, types, "") # last is function type self.in_module = []
def __init__(self, scene, colour=(255, 255, 255), pos=(0, 0, 0), rot=(0, 0, 0)): Object.__init__(self, scene, 'Light', colour, pos, rot) self.maxRange = 8 self.intensity = 20
def __init__(self, name, path, \ use, var, meth, call, \ types, fun_type): # Call mother's init Object.__init__(self, name, path, \ use, var, meth, call, types, fun_type) self.in_module = []
class SequentialTests: _iteration_count = 0 _deque = collections.deque() _object = Object() _lastObject = Object() def setup(self, iteration_count): self._iteration_count = iteration_count self._lastObject._intProp = 10 for x in range(self._iteration_count - 1): self._deque.append(self._object) self._deque.append(self._lastObject) def test(self): return self._deque.remove(self._lastObject) def cleanup(self): self._deque.clear()
def __init__(self, scene, colour=(255, 255, 255), pos=(0, 0, 10), rot=(0, 0, 0)): Object.__init__(self, scene, 'Wall', colour, pos, rot) self.AddPoints((1, 1, 1)) #0 self.AddPoints((-1, 1, 1)) #1 self.AddPoints((-1, 1, -1)) #2 self.AddPoints((1, 1, -1)) #3 self.AddPoints((1, -1, 1)) #4 self.AddPoints((-1, -1, 1)) #5 self.AddPoints((-1, -1, -1)) #6 self.AddPoints((1, -1, -1)) #7 self.AddFace([0, 1, 5, 4]) self.AddFace([0, 3, 7, 4]) self.AddFace([6, 5, 1, 2]) self.AddFace([6, 7, 3, 2]) self.setImage("StoneB.png")
class FifoTests: _iteration_count = 0 _deque = collections.deque() _object = Object() def setup(self, iteration_count): self._iteration_count = iteration_count def test(self): for x in range(self._iteration_count): self._deque.append(self._object) for x in range(self._iteration_count): self._deque.popleft()
class IndexRetrievalTests: _list = [] _target = 0 _object = Object() def setup(self, iteration_count, target): self._target = target for x in range(iteration_count): self._list.append(self._object) def test(self): return self._list[self._target] def cleanup(self): self._list[:] = []
class KeyRetrievalTests: _dict = {} _target = 0 _object = Object() def setup(self, iteration_count, target): self._target = target for x in range(iteration_count): self._dict[x] = self._object def test(self): return self._dict.get(self._target) def cleanup(self): self._dict.clear()
def __init__(self, scene, pos = (0, 0, 0), rot = (0, 0, 0)): Object.__init__(self, scene, 'Bullet', (0, 0, 0), pos, rot) self.speed = 10 self.colour = (255, 255, 255) self.timer = 5