Imports System.ComponentModel
Imports System.Drawing

<Serializable()> _
Public Class Recipe
    Dim m_name As String
    Dim m_photo As Image
    Dim m_preparationTime As Integer
    Dim m_cookTime As Integer
    Dim m_temperature As Integer
    Dim m_directions As String
    Dim m_nutritionInfo As FoodNutrition
    Dim _courseType As String
    Dim _cuisineType As String
    Dim _foodType As String
    Private m_ingredients As BindingList(Of Ingredient)


    Public Property Name() As String
        Get
            Return m_name
        End Get
        Set(ByVal value As String)
            m_name = value
        End Set
    End Property

    Public Property Photo() As Image
        Get
            Return m_photo
        End Get
        Set(ByVal value As Image)
            m_photo = value
        End Set
    End Property

    Public Property Ingredients() As BindingList(Of Ingredient)
        Get
            Return m_ingredients
        End Get
        Set(ByVal value As BindingList(Of Ingredient))
            m_ingredients = value
        End Set
    End Property

    Public Property PreparationTime() As Integer
        Get
            Return m_preparationTime
        End Get
        Set(ByVal value As Integer)
            m_preparationTime = value
        End Set
    End Property

    Public Property CookTime() As Integer
        Get
            Return m_cookTime
        End Get
        Set(ByVal value As Integer)
            m_cookTime = value
        End Set
    End Property

    Public Property Temperature() As Integer
        Get
            Return m_temperature
        End Get
        Set(ByVal value As Integer)
            m_temperature = value
        End Set
    End Property

    Public Property Directions() As String
        Get
            Return m_directions
        End Get
        Set(ByVal value As String)
            m_directions = value
        End Set
    End Property

    Public Property NutritionInfo() As FoodNutrition
        Get
            Return m_nutritionInfo
        End Get
        Set(ByVal value As FoodNutrition)
            m_nutritionInfo = value
        End Set
    End Property


    Public Sub New()
        m_name = ""
        'm_ingredients = New cIngredient() {}
        m_preparationTime = 0
        m_cookTime = 0
        m_temperature = 0
        m_directions = ""
        m_nutritionInfo = New FoodNutrition()
    End Sub

    Public Sub New(ByVal name As String, ByVal ingredients() As Ingredient, ByVal preparationTime As Integer, ByVal cookTime As Integer, ByVal temperature As Integer, _
                   ByVal directions As String, ByVal nutritionInfo As FoodNutrition)
        m_name = name
        'm_ingredients = ingredients
        m_preparationTime = preparationTime
        m_cookTime = cookTime
        m_temperature = temperature
        m_directions = directions
        m_nutritionInfo = nutritionInfo
    End Sub

    Public Overrides Function ToString() As String
        Dim strRecipe As New System.Text.StringBuilder

        strRecipe.Append("Name: " & m_name & " Ingredients: ")
        For Each ingred In Ingredients
            strRecipe.Append(ingred.Name & " " & ingred.Amount)
        Next

        strRecipe.Append("Preparation Time: " & m_preparationTime & " Cook Time: " & m_cookTime & " Temperature: " & m_temperature & _
                         " Directions: " & m_directions & " NutritionInfo: " & m_nutritionInfo.ToString & " Recipe Type: " & " CuisineStyle: ")
        Return strRecipe.ToString
    End Function


End Class
