本文整理匯總了Python中ComponentManager.ComponentManager.cleanup方法的典型用法代碼示例。如果您正苦於以下問題:Python ComponentManager.cleanup方法的具體用法?Python ComponentManager.cleanup怎麽用?Python ComponentManager.cleanup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ComponentManager.ComponentManager
的用法示例。
在下文中一共展示了ComponentManager.cleanup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: next_level
# 需要導入模塊: from ComponentManager import ComponentManager [as 別名]
# 或者: from ComponentManager.ComponentManager import cleanup [as 別名]
def next_level():
if config.CurrentDungeonLevel > 0:
dungeonlevelid = config.DungeonLevelIds[config.CurrentDungeonLevel]
dungeonlevel = CM.get_Component('DungeonLevel', dungeonlevelid)
levelmap = CM.get_Component('Map', dungeonlevel.MapId)
for key in dungeonlevel.MonsterIds:
CM.cleanup(key)
for lst in levelmap.TileIds:
for key in lst:
CM.cleanup(key)
config.fov_recompute = True
config.playscreen.clear
config.CurrentDungeonLevel += 1
if config.CurrentDungeonLevel < 12:
newlevelid = EM.new_Id()
config.DungeonLevelIds[config.CurrentDungeonLevel] = newlevelid
mapid = config.mapgen.create(newlevelid)
newlevel = DungeonLevel(config.CurrentDungeonLevel, mapid)
CM.add_Component(newlevelid, 'DungeonLevel', newlevel)
Place_Monsters_On_Level(newlevelid)
else:
End_Game(finished=True)