예제 #1
0
    public void DisplayFinalResult(FinalResult result, MedalRow.MedalType[] medalTypes)
    {
        var text = result.ToString().ToUpper();

        transform.Find("FinalResult").GetComponent <Text>().text = text;

        var medalRows = transform.GetComponentsInChildren <MedalRow>();
        var i         = 0;

        foreach (var medalType in medalTypes)
        {
            medalRows[i++].SetMedalType(medalType);
        }
    }
        //Calculates the Total value of all boxes
        /// <summary>
        /// Calculates the Total value of all boxes
        /// </summary>
        /// <returns>
        /// Total calculated value
        /// </returns>
        public string GetCheckoutValue()
        {
            decimal FinalResult;

            //this if else statment is to prevent bugs with the + and - for the total value
            if (decimal.Parse(Allbalance.Text) < 0)
            {
                FinalResult = decimal.Parse(Allbalance.Text) + decimal.Parse(CountedCash.Text);

                return(CheckOut.Text = FinalResult.ToString());
            }
            else
            {
                FinalResult = decimal.Parse(Allbalance.Text) - decimal.Parse(CountedCash.Text);

                return(CheckOut.Text = FinalResult.ToString());
            }
        }
예제 #3
0
파일: View.cs 프로젝트: BAT453/First-Task
 public static void ViewResult(FinalResult s)
 {
     Console.WriteLine("\nYour resuls of this game: {0}", s.ToString().ToUpper());
 }