def render(self,PolygonList):
a = self.get_neighbours(PolygonList)
land = [i.terrain for i in a if i.terrain >= 0]
salt = [i for i in self.get_neighbours(PolygonList) if i.terrain < 0]
if len([i for i in self.vertices if i.river == True])/len(self.vertices) > 0.88:
if not salt:
self.terrain = 0
self.color = color_palettes.shallows[2]
if self.terrain < 0 and land:
self.terrain = -1
#self.color = color_palettes.shallows[0]
elif self.terrain > 0 and len(land) != len(a):
#coast = [i for i in self.vertices if i.coast]
#if len(coast) > 1:
# render_coast(coast)
if self.terrain > 2:
self.color = random.choice(color_palettes.cliff)
else:
self.terrain = 1
#self.color = random.choice(color_palettes.sand)
评论列表
文章目录