當前位置: 首頁>>代碼示例>>Python>>正文


Python ResourceManager.load方法代碼示例

本文整理匯總了Python中horizons.ai.aiplayer.resourcemanager.ResourceManager.load方法的典型用法代碼示例。如果您正苦於以下問題:Python ResourceManager.load方法的具體用法?Python ResourceManager.load怎麽用?Python ResourceManager.load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在horizons.ai.aiplayer.resourcemanager.ResourceManager的用法示例。


在下文中一共展示了ResourceManager.load方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _load

# 需要導入模塊: from horizons.ai.aiplayer.resourcemanager import ResourceManager [as 別名]
# 或者: from horizons.ai.aiplayer.resourcemanager.ResourceManager 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.resourcemanager.ResourceManager.load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。