本文整理汇总了Python中toontown.toon.ToonDNA.ToonDNA.getGender方法的典型用法代码示例。如果您正苦于以下问题:Python ToonDNA.getGender方法的具体用法?Python ToonDNA.getGender怎么用?Python ToonDNA.getGender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toon.ToonDNA.ToonDNA
的用法示例。
在下文中一共展示了ToonDNA.getGender方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enterLoadHouse
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import getGender [as 别名]
def enterLoadHouse(self):
dna = ToonDNA()
dna.makeFromNetString(self.toon['setDNAString'][0])
gender = 1 if dna.getGender() == 'm' else 0
self.mgr.air.sendActivate(self.houseId, self.mgr.air.districtId, self.estate.zoneId, self.mgr.air.dclassesByName['DistributedHouseAI'], {'setHousePos': [self.houseIndex],
'setColor': [self.houseIndex],
'setName': [self.toon['setName'][0]],
'setAvatarId': [self.toon['ID']],
'setGender': [gender]})
self.acceptOnce('generate-%d' % self.houseId, self.__gotHouse)
示例2: enterLoadHouse
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import getGender [as 别名]
def enterLoadHouse(self):
# Quickly parse DNA and get gender.
dna = ToonDNA()
dna.makeFromNetString(self.toon['setDNAString'][0])
gender = 1 if dna.getGender() == 'm' else 0
# Activate the house:
self.mgr.air.sendActivate(self.houseId, self.mgr.air.districtId, self.estate.zoneId,
self.mgr.air.dclassesByName['DistributedHouseAI'],
{'setHousePos': [self.houseIndex],
'setColor': [self.houseIndex],
'setName': [self.toon['setName'][0]],
'setAvatarId': [self.toon['ID']],
'setGender': [gender]})
# Now we wait for the house to show up... We do this by hanging a messenger
# hook which the DistributedHouseAI throws once it spawns.
self.acceptOnce('generate-%d' % self.houseId, self.__gotHouse)