import random
from game import constants
from game.actor import Actor
from game.point import Point

class Food(Actor):
    '''This keeps track of the food item and how much each piece is worth.

    attributes:

    
    '''
    def __init__(self):
        '''constructor
        
        '''
        super().__init__()
        self.set_text('@')
        self._points = 0 
        self.reset()

    def reset(self):
        '''changes the postion of the food and worth
        

        
        '''

        self._points = random.randint(1,5)
        pos_x = random.randint(0, constants.MAX_X)
        pos_y = random.randint(0, constants.MAX_Y)
        position = Point(pos_x, pos_y)
        self.set_position(position)

    def get_points(self):
        '''returns points
        
        '''
        return self._points
