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


Python IDataHolder.relChng方法代码示例

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


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

示例1: XXXgetDiplomacyWith

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import relChng [as 别名]
	def XXXgetDiplomacyWith(self, tran, obj, playerID):
		if obj.oid == playerID:
			return REL_UNITY
		player = tran.db.get(playerID, None)
		if player.type == T_AIEDENPLAYER:
			dipl = obj.diplomacyRels.get(playerID, None)
			if not dipl:
				# make default
				dipl = IDataHolder()
				dipl.type = T_DIPLREL
				dipl.pacts = {
						PACT_ALLOW_CIVILIAN_SHIPS: [PACT_ACTIVE, PACT_ALLOW_CIVILIAN_SHIPS],
						PACT_ALLOW_MILITARY_SHIPS: [PACT_ACTIVE, PACT_ALLOW_MILITARY_SHIPS]
				}
				dipl.relation = REL_FRIENDLY
				dipl.relChng = 0
				dipl.lastContact = tran.db[OID_UNIVERSE].turn
				dipl.contactType = CONTACT_NONE
				dipl.stats = None
				if playerID != obj.oid:
					obj.diplomacyRels[playerID] = dipl
				else:
					log.debug("getDiplomacyWith myself", obj.oid)
			return dipl
		# this AI battles with overyone
		# make default
		dipl = IDataHolder()
		dipl.type = T_DIPLREL
		dipl.pacts = {}
		dipl.relation = REL_ENEMY
		dipl.relChng = 0
		dipl.lastContact = tran.db[OID_UNIVERSE].turn
		dipl.contactType = CONTACT_NONE
		dipl.stats = None
		return dipl
开发者ID:mozts2005,项目名称:OuterSpace,代码行数:37,代码来源:IPiratePlayer.py

示例2: forceAllyWithEDEN

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import relChng [as 别名]
	def forceAllyWithEDEN(self,tran,obj):
		for partyID in obj.diplomacyRels.keys():
			party = tran.db.get(partyID, None)
			if party.type == T_AIEDENPLAYER:
				diplSelf = obj.diplomacyRels.get(party.oid, None)
				log.debug("Allying Pirate with EDEN (forced)", obj.oid, partyID)
				diplEDEN = IDataHolder()
				diplEDEN.type = T_DIPLREL
				diplEDEN.pacts = {
						PACT_ALLOW_CIVILIAN_SHIPS: [PACT_ACTIVE, PACT_ALLOW_CIVILIAN_SHIPS],
						PACT_ALLOW_MILITARY_SHIPS: [PACT_ACTIVE, PACT_ALLOW_MILITARY_SHIPS]
				}
				diplEDEN.relation = REL_FRIENDLY
				diplEDEN.relChng = 0
				diplEDEN.lastContact = tran.db[OID_UNIVERSE].turn
				diplEDEN.contactType = CONTACT_STATIC
				diplEDEN.stats = None

				diplSelf.relation = REL_FRIENDLY
				diplSelf.pacts = {
					PACT_ALLOW_CIVILIAN_SHIPS: [PACT_ACTIVE, PACT_ALLOW_CIVILIAN_SHIPS],
					PACT_ALLOW_MILITARY_SHIPS: [PACT_ACTIVE, PACT_ALLOW_MILITARY_SHIPS]
				}
				
				obj.diplomacyRels[party.oid] = diplSelf
				party.diplomacyRels[obj.oid] = diplEDEN
开发者ID:mozts2005,项目名称:OuterSpace,代码行数:28,代码来源:IPiratePlayer.py

示例3: getDiplomacyWith

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import relChng [as 别名]
	def getDiplomacyWith(self, tran, obj, playerID):
		if obj.oid == playerID:
			return REL_UNITY
		# this AI battles with overyone
		# make default
		dipl = IDataHolder()
		dipl.type = T_DIPLREL
		dipl.pacts = {}
		dipl.relation = REL_ENEMY
		dipl.relChng = 0
		dipl.lastContact = tran.db[OID_UNIVERSE].turn
		dipl.contactType = CONTACT_NONE
		dipl.stats = None
		return dipl
开发者ID:mozts2005,项目名称:OuterSpace,代码行数:16,代码来源:IAIMutantPlayer.py

示例4: getDiplomacyWith

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import relChng [as 别名]
def getDiplomacyWith(contactID):
    obj = getPlayer()
    dipl = obj.diplomacyRels.get(contactID, None)
    if not dipl:
        # make default
        dipl = IDataHolder()
        dipl.type = T_DIPLREL
        dipl.pacts = {PACT_ALLOW_CIVILIAN_SHIPS: [PACT_ACTIVE, PACT_ALLOW_CIVILIAN_SHIPS]}
        dipl.relation = obj.defaultRelation
        dipl.relChng = 0
        dipl.lastContact = 0
        dipl.stats = None
        dipl.contactType = CONTACT_NONE
        obj.diplomacyRels[playerID] = dipl
    return dipl
开发者ID:ospaceteam,项目名称:outerspace,代码行数:17,代码来源:client.py

示例5: getDiplomacyWith

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import relChng [as 别名]
	def getDiplomacyWith(self, tran, obj, playerID):
		if obj.governorOf:
			# player is a governor
			leader = tran.db[obj.governorOf]
			return self.cmd(leader).getDiplomacyWith(tran, leader, objID)
		# player is independent
		dipl = obj.diplomacyRels.get(playerID, None)
		if not dipl:
			# make default
			dipl = IDataHolder()
			dipl.type = T_DIPLREL
			dipl.pacts = {
				PACT_ALLOW_CIVILIAN_SHIPS: [PACT_ACTIVE, PACT_ALLOW_CIVILIAN_SHIPS]
			}
			dipl.relation = obj.defaultRelation
			dipl.relChng = 0
			dipl.lastContact = tran.db[OID_UNIVERSE].turn
			dipl.contactType = CONTACT_NONE
			dipl.stats = None
			if playerID != obj.oid:
				obj.diplomacyRels[playerID] = dipl
			else:
				log.debug("getDiplomacyWith myself", obj.oid)
		return dipl
开发者ID:mozts2005,项目名称:OuterSpace,代码行数:26,代码来源:IPlayer.py


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