本文整理匯總了Python中region.Region.is_wasteland方法的典型用法代碼示例。如果您正苦於以下問題:Python Region.is_wasteland方法的具體用法?Python Region.is_wasteland怎麽用?Python Region.is_wasteland使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類region.Region
的用法示例。
在下文中一共展示了Region.is_wasteland方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup_map
# 需要導入模塊: from region import Region [as 別名]
# 或者: from region.Region import is_wasteland [as 別名]
def setup_map(self, options):
'''
Method to set up essential map data given by the server.
'''
map_type = options[0]
for i in range(1, len(options), 2):
if map_type == 'super_regions':
super_region = SuperRegion(options[i], int(options[i + 1]))
self.map.super_regions.append(super_region)
elif map_type == 'regions':
super_region = self.map.get_super_region_by_id(options[i + 1])
region = Region(options[i], super_region)
self.map.regions.append(region)
super_region.regions.append(region)
elif map_type == 'neighbors':
region = self.map.get_region_by_id(options[i])
neighbours = [self.map.get_region_by_id(region_id) for region_id in options[i + 1].split(',')]
for neighbour in neighbours:
region.neighbours.append(neighbour)
neighbour.neighbours.append(region)
if map_type == 'wastelands':
for i in range(1, len(options)):
region = self.map.get_region_by_id(options[i])
region.is_wasteland = True
if map_type == 'neighbors':
for region in self.map.regions:
if region.is_on_super_region_border:
continue
for neighbour in region.neighbours:
if neighbour.super_region.id != region.super_region.id:
region.is_on_super_region_border = True
neighbour.is_on_super_region_border = True