Beispiel #1
0
    def testChooseGirlInputlet(self):
        from game.autoenv import user_input
        from gamepack.thb.common import CharChoice
        from gamepack.thb.characters.youmu import Youmu
        from gamepack.thb.characters.seiga import Seiga
        from gamepack.thb.inputlets import ChooseGirlInputlet

        g, p = self.makeGame()
        choices = [CharChoice(Youmu), CharChoice(Seiga)]
        mapping = {p: choices}

        ilet = ChooseGirlInputlet(self, mapping)
        ilet.actor = p
        ilet.set_choice(choices[0])
        eq_(ilet.data(), 0)

        p.client.gdlist.append([r'>I:ChooseGirl:\d+', 0])
        ilet = ChooseGirlInputlet(self, mapping)
        eq_(user_input([p], ilet), choices[0])
Beispiel #2
0
    def testChooseGirlInputlet(self):
        from game.autoenv import user_input
        from gamepack.thb.common import CharChoice
        from gamepack.thb.characters.youmu import Youmu
        from gamepack.thb.characters.seiga import Seiga
        from gamepack.thb.inputlets import ChooseGirlInputlet

        g, p = self.makeGame()
        choices = [CharChoice(Youmu), CharChoice(Seiga)]
        mapping = {p: choices}

        ilet = ChooseGirlInputlet(self, mapping)
        ilet.actor = p
        ilet.set_choice(choices[0])
        eq_(ilet.data(), 0)

        p.client.gdlist.append([r'>I:ChooseGirl:\d+', 0])
        ilet = ChooseGirlInputlet(self, mapping)
        eq_(user_input([p], ilet), choices[0])