import pygame

class Indicator:
    def __init__(self):
        self.ypos = 0
        self.xpos = 0
        self.coor = 0
        self.upsteps = 1
        self.downsteps = 1
        self.rightsteps = 1
        self.leftsteps = 1
        self.sprite = pygame.image.load("Images/range.png")

    def posDraw(self, row, column, cell_width, cell_height, cell_margin, width):
        if row == self.xpos and column == self.ypos:
            self.coor =  [((cell_margin + cell_width) * column + cell_margin) + (width * 0.2185),
                                  (cell_margin + cell_height) * row + cell_margin,
                                  cell_width,
                                  cell_height]

    def draw(self, screen, size):
        self.sprite = pygame.transform.scale(self.sprite,((int(size)),(int((size)))))
        screen.blit(self.sprite, self.coor)

    def modPos(self, ymod, xmod):
        self.xpos += xmod
        self.ypos += ymod
        self.xpos = int(self.xpos)
        self.ypos = int(self.ypos)

    def resetSteps(self):
        self.rightsteps = 1
        self.leftsteps = 1
        self.upsteps = 1
        self.downsteps = 1