本文整理汇总了Python中bravo.world.World.season方法的典型用法代码示例。如果您正苦于以下问题:Python World.season方法的具体用法?Python World.season怎么用?Python World.season使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bravo.world.World
的用法示例。
在下文中一共展示了World.season方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: retrieve_plugins
# 需要导入模块: from bravo.world import World [as 别名]
# 或者: from bravo.world.World import season [as 别名]
d = retrieve_plugins(ITerrainGenerator)
size = int(sys.argv[1])
pipeline = [d[name] for name in sys.argv[2].split(",")]
target = sys.argv[3]
if not os.path.exists(target):
os.makedirs(target)
print "Making map of %dx%d chunks in %s" % (size, size, target)
print "Using pipeline: %s" % ", ".join(plugin.name for plugin in pipeline)
world = World(target)
world.pipeline = pipeline
world.season = None
counts = [1, 2, 4, 5, 8]
count = 0
total = size ** 2
cpu = 0
before = time.time()
for i, j in product(xrange(size), repeat=2):
start = time.time()
chunk = world.load_chunk(i, j)
cpu += (time.time() - start)
world.save_chunk(chunk)
count += 1
if count >= counts[0]:
print "Status: %d/%d (%.2f%%)" % (count, total, count * 100 / total)