"""The potion class."""


class Potion:
    """A class for brewing potions."""

    def __init__(self, student_name):
        self.colour = 'there-is-no-potion-so-the-potion-has-no-color'
        self.cooked = False
        self.container = None
        self.heat_source = None
        self.ingredients = []
        self.simmer_duration = -1
        self.student_name = student_name

    def setup(self, container=None, heat_source=None):
        """Add a container and/or heat_source to the potion.

        Updates container and heat_source attributes in the class instance.

        Parameters
        ----------
        container : str, optional
            The name of the container to brew the potion in.
        heat_source : str, optional
            The name of the heat source used to cook the potions
        """
        if container is None:
            print('You have not specified a container - where will you brew your potion?')
        if heat_source is None:
            print('You have not specified a heat source - how will you cook the potion?')
        self.container = container
        self.heat_source = heat_source

    def add_ingredients(self, ingredients=None):
        """Add ingredients to the potion.

        Updates ingredients and colour attributes in the class instance.

        Parameters
        ----------
        ingredients : array_like, optional
            A list of ingredients (str) to add to the potion.
        """
        if ingredients is None:
            print('You have added no ingredients - have you spilt them on the floor again?')
        else:
            self.ingredients = ingredients
            self.colour = "transparent"
