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


Python ToonDNA.getGender方法代码示例

本文整理汇总了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)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:12,代码来源:EstateManagerAI.py

示例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)
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:20,代码来源:EstateManagerAI.py


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