예제 #1
0
 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)
예제 #2
0
    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)
예제 #3
0
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)
예제 #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))
예제 #5
0
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))