Ejemplo n.º 1
0
 def generateRandomCharacter():
     # Get instance of classes
     items = Items.getInstance()
     config = Config.getInstance()
     # Generate all items for new character
     gen = [items.getRandomItem(item) if item != ItemTypes.ALTURA else items.getRandomHeight() for item in ItemTypes]
     # Return character, generated items should be in correct positions
     return Character(config.clase, gen[0], gen[1], gen[2], gen[3], gen[4], gen[5])
Ejemplo n.º 2
0
    def __getRandomGene(geneIdx):
        items = Items.getInstance()
        # Get item for that index
        item = ItemTypes(geneIdx)
        # Generate random item
        if item != ItemTypes.ALTURA:
            newItem = items.getRandomItem(item)
        else:
            newItem = items.getRandomHeight()

        return newItem