/// <summary> /// A constructor for PriceCalculator object. Initializes members and prepares them for calculating. /// </summary> /// <remarks> /// NAME: PriceCalculator /// AUTHOR: Ryan Osgood /// DATE: 9/3/2019 /// </remarks> /// <param name="a_entree">The Entree whose price needs calculating</param> public PriceCalculator(Entree a_entree) { BasePrice = a_entree.Price; m_copyOfAttrs = new int[a_entree.DecomposeAttributes().Length]; m_copyOfOriginalAttrs = new int[a_entree.DecomposeOriginalAttributes().Length]; Array.Copy(a_entree.DecomposeAttributes(), m_copyOfAttrs, a_entree.DecomposeAttributes().Length); Array.Copy(a_entree.DecomposeOriginalAttributes(), m_copyOfOriginalAttrs, a_entree.DecomposeOriginalAttributes().Length); }/*public PriceCalculator(Entree a_entree)*/
}/*public AttributeModification()*/ /// <summary> /// A constructor for the AttributeModification form. Inherits from the default /// constructor and passes in a Entree as an argument. /// Initializes all vital members for the entree modifications. /// </summary> /// <remarks> /// NAME: AttributeModification /// AUTHOR: Ryan Osgood /// DATE: 8/17/2019 /// </remarks> /// <param name="a_entreeFromMain">The entree to be modified.</param> public AttributeModification(Entree a_entreeFromMain) : this() { m_entreeToBeModified = a_entreeFromMain; m_attributes = m_entreeToBeModified.DecomposeAttributes(); m_entreeView = new EntreeView(m_entreeToBeModified); m_entreeView.DecomposeAttributesToString(); lbModifiedEntree.DataSource = m_entreeView.GetTextMods(); GenerateAttributeButtonListAndSetProperties(); GenerateOriginalAttrs(); CompleteButtonDisplay(); }/*public AttributeModification(Entree a_entreeFromMain) : this()*/
}/*public EntreeView(Entree a_entree)*/ /// <summary> /// The setup method for firing off the other view formatting methods. /// </summary> /// <remarks> /// NAME: DecomposeAttributesToString /// AUTHOR: Ryan Osgood /// DATE: 8/16/2019 /// </remarks> /// <returns> /// The formatted view of the EntreeView's attributes. /// </returns> public string DecomposeAttributesToString() { m_attrBuilder.Clear(); m_textAttributes.Clear(); int[] sandwichAttrs = m_entree.DecomposeAttributes(); int[] sandwichOriginalAttrs = m_entree.DecomposeOriginalAttributes(); string sandwichIdentifier = m_entree.EntreeIdentifier; m_textAttributes.Add(sandwichIdentifier); m_attrBuilder.AppendLine(sandwichIdentifier); if (sandwichIdentifier != null) { AddTextAttributeModificationsToView(sandwichAttrs, sandwichOriginalAttrs); StartAddingTextAttributeProteinAdditionsToViewForBeef(sandwichAttrs, sandwichIdentifier); StartAddingTextAttributeProteinAdditionsToViewForGrilled(sandwichAttrs, sandwichIdentifier); StartAddingTextAttributeProteinAdditionsToViewForCrispy(sandwichAttrs, sandwichIdentifier); StartAddingTextAttributeProteinAdditionsToViewForBlackBean(sandwichAttrs, sandwichIdentifier); AddTextActionModifiersToView(); } return(m_attrBuilder.ToString()); }/*public string DecomposeAttributesToString()*/