本文整理汇总了Python中Block.Block.setPlots方法的典型用法代码示例。如果您正苦于以下问题:Python Block.setPlots方法的具体用法?Python Block.setPlots怎么用?Python Block.setPlots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block.Block
的用法示例。
在下文中一共展示了Block.setPlots方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: City
# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import setPlots [as 别名]
city = City("Paris", field)
road = Road([Coordinates(50, 0, 5), Coordinates(50, 50, 5)])
field.addNetwork(road)
districtBoundaries = [Coordinates(10, 10, 0), Coordinates(40, 10, 0), Coordinates(40, 90, 0), Coordinates(10, 90, 0)]
district = District()
district.setBoundaries(districtBoundaries)
field.setDistricts([district])
habitation = HabitationBuilding(districtBoundaries, 50)
function = FunctionBuilding(districtBoundaries, 20)
area = Area(districtBoundaries)
blocks=[]
for i in range(10):
block = Block()
block.canBuild = True
block.setPlots([habitation, function, area])
blocks.append(block)
district.setblocks(blocks)
traductor = Traductor();
traductor.draw(city)
city.serialize()
deserializedCity = City.deserialize(city.getName() + ".cgxml")
print(deserializedCity)