本文整理汇总了Python中horizons.ai.aiplayer.trademanager.TradeManager.load方法的典型用法代码示例。如果您正苦于以下问题:Python TradeManager.load方法的具体用法?Python TradeManager.load怎么用?Python TradeManager.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类horizons.ai.aiplayer.trademanager.TradeManager
的用法示例。
在下文中一共展示了TradeManager.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _load
# 需要导入模块: from horizons.ai.aiplayer.trademanager import TradeManager [as 别名]
# 或者: from horizons.ai.aiplayer.trademanager.TradeManager 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)