import pygame
from Code.Config import Colors, SquareConfig


class Square:
    def __init__(self, x_pos, y_pos):
        self.rect = pygame.Rect(x_pos, y_pos, SquareConfig.width, SquareConfig.height)
        self.color = SquareConfig.unclicked_color
        self.active = False

    def update(self, active):
        self.active = active

        if active:
            self.color = SquareConfig.clicked_color
        else:
            self.color = SquareConfig.unclicked_color

    def draw(self, window):

        pygame.draw.rect(window, self.color, self.rect)
