Ejemplo n.º 1
0
    def updateTank(self, tank):
        fraction = tank.get('fraction')

        if not ObjectFactory.updateTank(tank):
            movingHandler = MovingHandlersFactory.getInstance(fraction)

            newTank = TankFactory.getInstance(tank)
            newTank.do(movingHandler())

            LayoutFactory.addTank(newTank, fraction)
            ObjectFactory.addTank(newTank, fraction)
Ejemplo n.º 2
0
    def tanks(self):
        if self.arguments.get('tanks'):
            for tank in self.arguments.get('tanks'):
                fraction = tank.get('fraction')
                type = tank.get('type')

                movingHandler = MovingHandlersFactory.getInstance(fraction)

                Tank = TankFactory.getInstance(type)
                Tank.do(movingHandler())

                Tank.position = (tank.get('x'), tank.get('y'))

                #settings.collision_manager.add(Tank1)

                LayoutFactory.addTank(Tank, fraction)
                ObjectFactory.addTank(Tank, fraction)