本文整理匯總了Python中toontown.pets.PetDNA.getGenderString方法的典型用法代碼示例。如果您正苦於以下問題:Python PetDNA.getGenderString方法的具體用法?Python PetDNA.getGenderString怎麽用?Python PetDNA.getGenderString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類toontown.pets.PetDNA
的用法示例。
在下文中一共展示了PetDNA.getGenderString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: makePetList
# 需要導入模塊: from toontown.pets import PetDNA [as 別名]
# 或者: from toontown.pets.PetDNA import getGenderString [as 別名]
def makePetList(self):
self.numPets = len(self.petSeeds)
self.curPet = 0
self.petDNA = []
self.petName = []
self.petDesc = []
self.petCost = []
for i in xrange(self.numPets):
random.seed(self.petSeeds[i])
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(self.petSeeds[i], zoneId)
cost = PetUtil.getPetCostFromSeed(self.petSeeds[i], zoneId)
traits = PetTraits.PetTraits(traitSeed, zoneId)
traitList = traits.getExtremeTraitDescriptions()
numGenders = len(PetDNA.PetGenders)
gender = i % numGenders
PetDNA.setGender(dna, gender)
self.petDNA.append(dna)
self.petName.append(TTLocalizer.PetshopUnknownName)
descList = []
descList.append(TTLocalizer.PetshopDescGender % PetDNA.getGenderString(gender=gender))
if traitList:
descList.append(TTLocalizer.PetshopDescTrait % traitList[0])
else:
descList.append(TTLocalizer.PetshopDescTrait % TTLocalizer.PetshopDescStandard)
traitList.extend(['',
'',
'',
''])
for trait in traitList[1:4]:
descList.append('\t%s' % trait)
descList.append(TTLocalizer.PetshopDescCost % cost)
self.petDesc.append('\n'.join(descList))
self.petCost.append(cost)