本文整理匯總了Python中horizons.ai.aiplayer.productionbuilder.ProductionBuilder.load方法的典型用法代碼示例。如果您正苦於以下問題:Python ProductionBuilder.load方法的具體用法?Python ProductionBuilder.load怎麽用?Python ProductionBuilder.load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類horizons.ai.aiplayer.productionbuilder.ProductionBuilder
的用法示例。
在下文中一共展示了ProductionBuilder.load方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _load
# 需要導入模塊: from horizons.ai.aiplayer.productionbuilder import ProductionBuilder [as 別名]
# 或者: from horizons.ai.aiplayer.productionbuilder.ProductionBuilder 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)