Esempio n. 1
0
    private void Awake()
    {
        if (instance == null)
        {
            DontDestroyOnLoad(gameObject);
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        #region populate all arrays/lists using our .json files

        _questionJson = Application.streamingAssetsPath + "/Text/AllQuestions.json"; //find location of AllQuestions.json
        string allQuestionText = File.ReadAllText(_questionJson);                    //read all the text in that .json file
        questionData = QuestionData.CreatFromJson(allQuestionText);                  //convert text in that .json file into something that Unity can read
        //(in this case, an object containing a List of strings)

        questionPool = questionData.questionPool.questions;                      //initialize our List variable as the List of strings in our .json file

        _answerJson = Application.streamingAssetsPath + "/Text/AllAnswers.json"; //find location of AllAnswers.json
        string allAnswerText = File.ReadAllText(_answerJson);                    //read all the text in that .json file
        characterData = CharacterData.CreateFromJson(allAnswerText);             //convert text in that .json file into something that Unity can read
        //(in this case, an array of objects, each containing a string name, and a List of string answers)

        _endingJson = Application.streamingAssetsPath + "/Text/AllEndings.json"; //find location of AllEndings.json
        string allEndingText = File.ReadAllText(_endingJson);                    //read all the text in that .json file
        endingData = EndingData.CreateFromJson(allEndingText);                   //convert text in that .json file into something that Unity can read
        //(in this case, an array of objects, each containing a string name, and an array of string parings)

        #endregion
    }
Esempio n. 2
0
        public RunTestsForm(ref dao.QATestCollection tests, IMap map, TransactionManager tm, QAManager qa)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            if (tests == null)
                throw new ArgumentNullException("tests", "Must pass collection of QA tests to RunTestsForm");
            if (tests.Count == 0)
                throw new ArgumentException("No QA tests passed to RunTestsForm", "tests");
            if (map == null)
                throw new ArgumentNullException("map", "Must pass the focus map to RunTestsForm");

            this._tests = tests;
            this._tm = tm;
            this._qa = qa;
            this._map = map;
            this._defaults = new util.SystemDefaults();

            // Throw TM stuff at the QA tests and see if it sticks
            if (tm.Current() != null)
            {
                object[] theArgs = new object[2] {
                                                 new ISDUTLib.tm.dao.EditsDAO((IFeatureWorkspace)tm.Current().PGDBConnection, tm.transactionConfig()),
                                                 tm.transactionConfig()
                                             };
                for (int i = 0; i < this._tests.Count; i++)
                {
                    this._tests.get_Test(i).Test.UserData = theArgs;
                }
            }
        }
Esempio n. 3
0
 public void QAManagerConstructOptional()
 {
     // Type 2 - 1 parameter
     qa = new QAManager(Enums.QAType.Str, "NoQuestion at all");
     Assert.AreEqual(qa.Question, "Please specify a value (Default=NoQuestion at all, C=Cancel)");
     // Type 2 - 2 parameters
     qa = new QAManager(Enums.QAType.YN, "Duh", "Q with default 'Duh'");
     Assert.AreEqual(qa.Question, "Q with default 'Duh' (Default=Duh, C=Cancel)");
     // Type 3 - 1 parameter
     qa = new QAManager(new List <string> {
         "a", "b", "c"
     }, "Duh");
     Assert.AreEqual(qa.Question, "Please specify a value [a/b/c] (Default=Duh, C=Cancel)");
     // Type 3 - 2 parameters
     qa = new QAManager(new List <string> {
         "a", "b", "c"
     }, "Duh", "Q with default 'Duh'");
     Assert.AreEqual(qa.Question, "Q with default 'Duh' [a/b/c] (Default=Duh, C=Cancel)");
 }
Esempio n. 4
0
 public void QAManagerConstructDefault()
 {
     // Question types
     // Type 1 (custom question)
     qa = new QAManager("Hello world?");
     Assert.AreEqual(qa.Question, "Hello world? (C=Cancel)");
     // Type 2 (standard questions)
     qa = new QAManager(Enums.QAType.YN);
     Assert.AreEqual(qa.Question, "Please specify a value (Default=Y, C=Cancel)");
     qa = new QAManager(Enums.QAType.Dir);
     Assert.AreEqual(qa.Question, "Please specify an existing directory (C=Cancel)");
     qa = new QAManager(Enums.QAType.File);
     Assert.AreEqual(qa.Question, "Please specify a valid filename (C=Cancel)");
     // Type 3 (custom List of values)
     qa = new QAManager(new List <string> {
         "a", "b", "c"
     });
     Assert.AreEqual(qa.Question, "Please specify a value [a/b/c] (C=Cancel)");
 }