'''lecture31_veggie_ivs.py
`SweetPotato` inherits from `Veggie`.
Define same set of instance variables in child as parent

Oliver W. Layton
CS 151: Computational Thinking: Visual Media
Spring 2021
'''


class Veggie:
    def __init__(self, name, color, texture, flavor='Savory'):
        # Set our IVs
        self.name = name
        self.color = color
        self.texture = texture
        self.flavor = flavor

    def printInfo(self):
        print('I am a:', self.name)
        print('My color is:', self.color)
        print('My texture is:', self.texture)
        print('My flavor is:', self.flavor)


class SweetPotato(Veggie):
    # def __init__(self, name, color, texture, flavor='Savory'):
    # get rid of parameters that never change:
    def __init__(self, color):
        # Can think about this as copy-pasting Veggie constructor in here
        super().__init__(name='Sweet Potato', color=color, texture='Grainy', flavor='Sweet')
        # self.name = 'Sweet Potato'
        # self.color = color
        # self.texture = 'Grainy'
        # self.flavor = 'Sweet'
        # print('My color is:', self.color)


class Cucumber(Veggie):
    # pass
    def __init__(self, color, texture):
        super().__init__(name='Cucumber', color=color, texture=texture, flavor='Mild')
        # pass

# class Cucumber(Veggie):
    # pass


if __name__ == '__main__':
    # sweetPot1 = SweetPotato('Sweet potato', 'Purple', 'Grainy', 'Sweet')
    # sweetPot2 = SweetPotato('Sweet potato', 'Orange', 'Grainy', 'Sweet')
    # sweetPot3 = SweetPotato('Sweet potato', 'Purple', 'Grainy', 'Sweet')

    # After I simplify SweetPotato constructor parameters to leverage inheritance
    # sweetPot1 = SweetPotato('Purple')
    # sweetPot2 = SweetPotato('Orange')
    # sweetPot3 = SweetPotato('Purple')

    # sweetPot1.printInfo()

    cuc = Cucumber('Light green', 'Crunchy')
    cuc.printInfo()


    # cuc = Cucumber('Cucumber', 'Light green', 'Crunchy')
    # cuc.printInfo()
