Exemplo n.º 1
0
    def move(self, x0, y0, x1, y1):
        """Add logging to moving."""
        PlayerInfo.move(self, x0, y0, x1, y1)

        if self.points:
            if self.points[-1] != (x1, y1):
                self.points.append((x1, y1))
        else:
            if (x0, y0) == (x1, y1):
                self.points = [(x1, y1)]
            else:
                self.points = [(x0, y0), (x1, y1)]

        self.log('New coordinates: {} {} {} {}'.format(x0, y0, x1, y1))
Exemplo n.º 2
0
    def move(self, x0, y0, x1, y1):
        """Add logging to moving."""
        PlayerInfo.move(self, x0, y0, x1, y1)

        if self.points:
            if self.points[-1] != (x1, y1):
                self.points.append((x1, y1))
        else:
            if (x0, y0) == (x1, y1):
                self.points = [(x1, y1)]
            else:
                self.points = [(x0, y0), (x1, y1)]

        self.log('New coordinates: {} {} {} {}'.format(x0, y0, x1, y1))