本文整理匯總了Python中View.View.reset方法的典型用法代碼示例。如果您正苦於以下問題:Python View.reset方法的具體用法?Python View.reset怎麽用?Python View.reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類View.View
的用法示例。
在下文中一共展示了View.reset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: BeeForm
# 需要導入模塊: from View import View [as 別名]
# 或者: from View.View import reset [as 別名]
#.........這裏部分代碼省略.........
if self.beeclasses is None:
func = __import__
else:
func = lambda x: reload(__import__(x))
names = list(map(lambda x: splitext(x)[0],
[ file for file in listdir("bees")
if file.endswith(".py")]))
path.append("bees")
self.beeclasses = []
for name in names:
try:
self.beeclasses.append(getattr(func(name),name))
self.logline("Loaded " + name + ".py")
except Exception as e:
self.logline("\nFailed to load " + name + ".py")
self.logline(self.exception2str(e) + "\n")
def preparetheworld(self):
if self.checkbeearguments():
self.world = World(self.selectedbeeclass,
self.amountofbees,
self.widthofworld,
self.heightofworld,
self.beearguments.copy(),
self.worldseed)
self.view.startworldwidth = self.widthofworld
self.view.startworldheight = self.heightofworld
self.view.reset(self.world)
self.updatetime()
self.updateDrawingArea()
self.setupcomlist()
def startstop(self):
if self.world is not None:
if not self.running:
self.running = True
timeout_add(self.runworldinterval, self.runWorld)
else:
self.running = False
def stepback(self):
if self.world is not None:
if self.world.currentState > 0:
self.running = False
self.world.stepBackward()
self.updateDrawingArea()
self.updateComlist()
self.updatebeedebug()
self.updatetime()
def stepforward(self):
if self.world is not None:
self.running = False
self.world.stepForward()
self.updateDrawingArea()
self.updateComlist()
self.updatebeedebug()
self.updatetime()