当前位置: 首页>>代码示例>>Python>>正文


Python VillageBuilder.load方法代码示例

本文整理汇总了Python中horizons.ai.aiplayer.villagebuilder.VillageBuilder.load方法的典型用法代码示例。如果您正苦于以下问题:Python VillageBuilder.load方法的具体用法?Python VillageBuilder.load怎么用?Python VillageBuilder.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在horizons.ai.aiplayer.villagebuilder.VillageBuilder的用法示例。


在下文中一共展示了VillageBuilder.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _load

# 需要导入模块: from horizons.ai.aiplayer.villagebuilder import VillageBuilder [as 别名]
# 或者: from horizons.ai.aiplayer.villagebuilder.VillageBuilder import load [as 别名]
	def _load(self, db, owner, worldid):
		self.owner = owner
		super(SettlementManager, self).load(db, worldid)

		# load the main part
		land_manager_id = db("SELECT land_manager FROM ai_settlement_manager WHERE rowid = ?", worldid)[0][0]
		land_manager = WorldObject.get_object_by_id(land_manager_id)

		# find the settlement
		for settlement in self.owner.session.world.settlements:
			if settlement.owner == self.owner and settlement.island == land_manager.island:
				land_manager.settlement = settlement
				break
		assert land_manager.settlement
		self.resource_manager = ResourceManager.load(db, self)
		self.trade_manager = TradeManager.load(db, self)
		self.__init(land_manager)

		# load the master builders
		self.village_builder = VillageBuilder.load(db, self)
		self.production_builder = ProductionBuilder.load(db, self)
		self.village_builder.display()
		self.production_builder.display()

		self.__init_goals()

		# the add_building events happen before the settlement manager is loaded so they have to be repeated here
		for building in self.settlement.buildings:
			self.add_building(building)
开发者ID:STEVEOO6,项目名称:unknown-horizons,代码行数:31,代码来源:settlementmanager.py


注:本文中的horizons.ai.aiplayer.villagebuilder.VillageBuilder.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。