Controls.Food.TotalPrice C# (CSharp) Method

TotalPrice() public method

public TotalPrice ( ) : double
return double
        public double TotalPrice()
        {
            double amount = 1;
            double sizePrice = 0;
            double optionsPrice = 0;
            if (sizes != null)
            {
                sizePrice = sizes.ReturnSingle().Price();
            }
            if (options != null)
            {
                if (Option() != null)
                {
                    optionsPrice = Option().Price();
                }
            }
            if (Amounts() != null)
            {
                amount = Amount();
            }
            return (price + sizePrice + optionsPrice) * amount;
        }