/// <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 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()*/