Esempio n. 1
0
    public void requestSpeech(int choose)
    {
        string text = speak[choose];

        if (choose == 3)
        {
            text = text + " " + totalMoneyCustomer + " " + DialogText.CURRENTCY;
        }

        SpeechSpeaker.requestSpeech(speak[choose], this.transform);


        //cashierDialog.transform.position = this.transform.position;
    }
Esempio n. 2
0
    public void requestSpeech(int choose)
    {
        string text = "";

        switch (choose)
        {
        case 0:
            text = "The " + name + " costs " + Price + " dollars and is " + " made in " + Madein;
            break;

        case 1:
            text = "" + Price;
            break;

        case 2:
            text = "" + Description;
            break;

        case 3:
            text = "" + Quotes;
            break;

        case 4:
            text = "" + Madein;
            break;

        case 5:
            text = "" + useful;
            break;

        default:
            break;
        }

        SpeechSpeaker.requestSpeech(text, this.transform);
    }
Esempio n. 3
0
        //Can I set this main to public?
        public static void Main(string[] args)
        {
            SpeechSpeaker.Speaker();

            IGradeTracker book = CreateGradeBook();

            try
            {
                using (FileStream stream = File.Open("grades.txt", FileMode.Open))
                    using (StreamReader reader = new StreamReader(stream))
                    {
                        string line = reader.ReadLine();
                        while (line != null)
                        {
                            float grade = float.Parse(line);
                            book.AddGrade(grade);
                            line = reader.ReadLine();
                        }
                    }

                //book.AddGrade(91f);
                //book.AddGrade(89.1f);
                //book.AddGrade(75f);
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine("Could not locate the file grades.txt");
                return;
            }
            catch (UnauthorizedAccessException ex)
            {
                Console.WriteLine("No access");
                return;
            }

            foreach (float grade in book)
            {
                Console.WriteLine(grade);
            }

            try
            {
                Console.WriteLine("Please enter a name for the book");
                book.Name = Console.ReadLine();
                //Delegate playground.
                //Book call deledgate Namgechanged. If namechanged is not null, then
                book.NameChanged += OnNameChanged;
                book.NameChanged += OnNameChanged;
                book.NameChanged += OnNameChanged2;
                book.NameChanged -= OnNameChanged;
            }
            catch (ArgumentException)
            {
                Console.WriteLine("Invalid name");
            }


            book.Name = "Allen's Book";
            WriteNames(book.Name);
            GradeStatistics stats = book.ComputeStatistics();

            Console.WriteLine(stats.AverageGrade);
            Console.WriteLine(stats.LowestGrade);
            Console.WriteLine(stats.HighestGrade);
            Console.WriteLine("{0} {1}", stats.LetterGrade, stats.Description);

            Console.WriteLine("Press any key to exist");
            Console.ReadLine();
        }