/// <summary>
        /// Function to randomize player answer options by using Next(1,4).
        /// Gets random string[3] dialogue and string[3] answers "Positive" "Neutral" or "Negative"
        /// which are used in a Dictionary later on to define the outcome of selecting
        /// this answer.
        /// </summary>
        /// <returns>string[3] Dialogue and out answers[3]</returns>
        public string[] randomSelection()
        {
            for (int i = 0; i < 3; i++)
            {
                select = random.Next(1, 4);
                switch (select)
                {
                case 1:
                    answers[i]  = DialoguePositive.getOutcome();
                    dialogue[i] = DialoguePositive.getAnswer();
                    break;

                case 2:
                    answers[i]  = DialogueNeutral.getOutcome();
                    dialogue[i] = DialogueNeutral.getAnswer();
                    break;

                case 3:
                    answers[i]  = DialogueNegative.getOutcome();
                    dialogue[i] = DialogueNegative.getAnswer();
                    break;
                }
            }
            return(dialogue);
        }
Exemplo n.º 2
0
        public string[] randomSelection()           //Used to generate random answer options for array answers[3]
        {
            for (int i = 0; i < 3; i++)
            {
                select = random.Next(1, 4);                  //Random number 1-3
                switch (select)
                {
                case 1:
                    answers[i] = DialoguePositive.getDialogue();                              //Print answer and return that answers[i] = Positive
                    break;

                case 2:
                    answers[i] = DialogueNeutral.getDialogue();                             //Print answer and return that answers[i] = Neutral
                    break;

                case 3:
                    answers[i] = DialogueNegative.getDialogue();                             //Print answer and return that answers[i] = Negative
                    break;
                }
            }
            return(answers);            //Return answers[3], which contains strings (Positive, Neutral, Negative)
        }