from Bricks.Brick import Brick


class LBlock(Brick):
    def __init__(self, x, y):
        # rotation pos: 1 right 2 down 3 left 4 up
        self.rotation_pos = 1
        super().__init__(x, y)

    def get_name(self):
        return "LBlock"

    def get_arm_direction(self):
        """ This function controls, if block is left or right mirrored """
        return 1

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x, y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.get_arm_direction())]

    def rotate_left(self):
        if self.rotation_pos == 1:
            self.rotation_pos = 4
        else:
            self.rotation_pos = self.rotation_pos - 1

    def rotate_right(self):
        if self.rotation_pos == 4:
            self.rotation_pos = 1
        else:
            self.rotation_pos = self.rotation_pos + 1

1a22c530bd977e95a2ce491d6e7ca2ce5eb799bd
<mask token>


class LBlock(Brick):

    def __init__(self, x, y):
        self.rotation_pos = 1
        super().__init__(x, y)
    <mask token>
    <mask token>

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.
                get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.
                get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x,
                y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.
                get_arm_direction())]
    <mask token>
    <mask token>

<mask token>


class LBlock(Brick):

    def __init__(self, x, y):
        self.rotation_pos = 1
        super().__init__(x, y)

    def get_name(self):
        return 'LBlock'

    def get_arm_direction(self):
        """ This function controls, if block is left or right mirrored """
        return 1

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.
                get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.
                get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x,
                y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.
                get_arm_direction())]
    <mask token>

    def rotate_right(self):
        if self.rotation_pos == 4:
            self.rotation_pos = 1
        else:
            self.rotation_pos = self.rotation_pos + 1

<mask token>


class LBlock(Brick):

    def __init__(self, x, y):
        self.rotation_pos = 1
        super().__init__(x, y)

    def get_name(self):
        return 'LBlock'

    def get_arm_direction(self):
        """ This function controls, if block is left or right mirrored """
        return 1

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.
                get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.
                get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x,
                y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.
                get_arm_direction())]

    def rotate_left(self):
        if self.rotation_pos == 1:
            self.rotation_pos = 4
        else:
            self.rotation_pos = self.rotation_pos - 1

    def rotate_right(self):
        if self.rotation_pos == 4:
            self.rotation_pos = 1
        else:
            self.rotation_pos = self.rotation_pos + 1

from Bricks.Brick import Brick


class LBlock(Brick):

    def __init__(self, x, y):
        self.rotation_pos = 1
        super().__init__(x, y)

    def get_name(self):
        return 'LBlock'

    def get_arm_direction(self):
        """ This function controls, if block is left or right mirrored """
        return 1

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.
                get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.
                get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x,
                y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.
                get_arm_direction())]

    def rotate_left(self):
        if self.rotation_pos == 1:
            self.rotation_pos = 4
        else:
            self.rotation_pos = self.rotation_pos - 1

    def rotate_right(self):
        if self.rotation_pos == 4:
            self.rotation_pos = 1
        else:
            self.rotation_pos = self.rotation_pos + 1

from Bricks.Brick import Brick


class LBlock(Brick):
    def __init__(self, x, y):
        # rotation pos: 1 right 2 down 3 left 4 up
        self.rotation_pos = 1
        super().__init__(x, y)

    def get_name(self):
        return "LBlock"

    def get_arm_direction(self):
        """ This function controls, if block is left or right mirrored """
        return 1

    def get_coords(self):
        x = self.get_x()
        y = self.get_y()
        if self.rotation_pos == 1:
            return [(x, y - 1), (x, y), (x, y + 1), (x + self.get_arm_direction(), y + self.get_arm_direction())]
        elif self.rotation_pos == 2:
            return [(x - 1, y), (x, y), (x + 1, y), (x - 1, y + self.get_arm_direction())]
        elif self.rotation_pos == 3:
            return [(x - self.get_arm_direction(), y - 1), (x, y - 1), (x, y), (x, y + 1)]
        elif self.rotation_pos == 4:
            return [(x - 1, y), (x, y), (x + 1, y), (x + 1, y - self.get_arm_direction())]

    def rotate_left(self):
        if self.rotation_pos == 1:
            self.rotation_pos = 4
        else:
            self.rotation_pos = self.rotation_pos - 1

    def rotate_right(self):
        if self.rotation_pos == 4:
            self.rotation_pos = 1
        else:
            self.rotation_pos = self.rotation_pos + 1
