本文整理汇总了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)