def loadTrainerFromPlayerElement(self, playerElement):
     """ Load a trainer from a player element """
     trainerElement = playerElement.find(Tags.trainerTag)
     title = trainerElement.findtext(Tags.titleTag)
     name = trainerElement.findtext(Tags.nameTag)
     
     return TrainerFactory.loadFromXML(title, name, trainerType=TrainerFactory.HUMAN)
    def loadTrainerFromPlayerElement(self, playerElement):
        """ Load a trainer from a player element """
        trainerElement = playerElement.find(Tags.trainerTag)
        title = trainerElement.findtext(Tags.titleTag)
        name = trainerElement.findtext(Tags.nameTag)

        return TrainerFactory.loadFromXML(title,
                                          name,
                                          trainerType=TrainerFactory.HUMAN)
def LoadTrainer(element):
    """ Load trainer from a Person Element """
    trainerElement = element.find(Tags.trainerTag)
    title = trainerElement.findtext(Tags.titleTag)
    name = trainerElement.findtext(Tags.nameTag)
    return TrainerFactory.loadFromXML(title, name, TrainerFactory.COMPUTER)
Beispiel #4
0
 def play(self, entry=None):
     """ Play a Battle with the Trainer from the entry """
     enemy = TrainerFactory.loadFromXML("Badass", "Eric",
                                        TrainerFactory.COMPUTER)
     self.runController(BattleController(entry.trainer, enemy))
def LoadTrainer(element):
    """ Load trainer from a Person Element """
    trainerElement = element.find(Tags.trainerTag)
    title = trainerElement.findtext(Tags.titleTag)
    name = trainerElement.findtext(Tags.nameTag)
    return TrainerFactory.loadFromXML(title, name, TrainerFactory.COMPUTER)
 def play(self, entry=None):
     """ Play a Battle with the Trainer from the entry """
     enemy = TrainerFactory.loadFromXML("Badass", "Eric", TrainerFactory.COMPUTER)
     self.runController(BattleController(entry.trainer, enemy))