MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/361168_Vpython_example/recipe-361168.py:186–193  ·  view source on GitHub ↗

Pass a reference to the stacks object that holds all the blocks and the index of the initial stack of the block

(self, stacks, position)

Source from the content-addressed store, hash-verified

184class VBlock(Block):
185
186 def __init__(self, stacks, position):
187 """
188 Pass a reference to the stacks object that holds all the blocks
189 and the index of the initial stack of the block
190 """
191 Block.__init__(self, stacks, position)
192 self.box = box(pos=(position-(stacks.blockCount/2), 0, 0), size=(.9,.9,.9), color=color.blue)
193 self.label = label(pos=array(self.box.pos) + array([0,0,1]), text=str(position), opacity=0, box=0, line=0)
194
195 def moveTo(self, newPosition):
196 """Simply puts the block on top of the stack numbered newPosition"""

Callers

nothing calls this directly

Calls 4

boxFunction · 0.85
strFunction · 0.85
arrayClass · 0.50
__init__Method · 0.45

Tested by

no test coverage detected