import abc


class Burger:
    """
    Define the interface of interest to clients.
    Maintain a reference to a Strategy object.
    """

    def __init__(self, pattytype):
        self._pattytype = pattytype

    def burger_interface(self):
        print('Start by adding a bottom bun')
        self._pattytype.MakePatty()
        print('Then add a top bun')
        print('Serve\n\n')

    def changePatty(self, new_patty):
        self._pattytype = new_patty

class MakePattyBehavior(metaclass=abc.ABCMeta):
    """
    Declare an interface common to all supported algorithms.
    Context (in this case Burger) uses this interface (MakePattyBehavior)
    to call the algorithm defined by a ConcreteStrategy (cheeseburger,
    grilled chicken or veggie).
    """

    @abc.abstractmethod
    def MakePatty(self):
        pass


class cheeseburger (MakePattyBehavior):
    """
    Implement the cheeseburger algorithm using the MakePattyBehavior interface.
    """

    def MakePatty(self):
        print('Add a slice of cheese')
        print('Add a beef patty')


class grilledchicken(MakePattyBehavior):
    """
    Implement the grilledchicken algorithm using the MakePattyBehavior interface.
    """

    def MakePatty(self):
        print('Add a grilled chicken breast')


class veggie(MakePattyBehavior):
    """
    Implement the veggie algorithm using the MakePattyBehavior interface.
    """

    def MakePatty(self):
        print('Add a soybean-based patty')



def main():
    MyBurger = Burger(cheeseburger())
    MyBurger.burger_interface()


    MyBurger.changePatty(veggie())
    MyBurger.burger_interface()


if __name__ == "__main__":
    main()

'''
    In summary:
    Cheeseburger, Grilled Chicken and Veggie are our Concrete Strategies.
    Each defines how its patty/filling should be made.
    The Burger class is our context.
    The Burger class is configured with a concrete strategy and it uses the concrete strategy
    later when a burger needs to be cooked.
'''
