Esempio n. 1
0
        private void BindData()
        {
            TaskBLL TaskBL = new TaskBLL(connectionString);
            List<TaskViewModel> tasks = TaskBL.GetTaskInventory();
            Dictionary<int, string> CarID_Name = TaskBL.GetNameListFromCarTable();
            Dictionary<int, string> EmployeeID_Name = TaskBL.GetNameListFromEmployeeTable();
            string[] date_notime = new string[3];

            foreach (TaskViewModel element in tasks)
            {
                date_notime = element.DateAssigned.Split(' ');
                element.DateAssigned = date_notime[0];

                if (!String.IsNullOrEmpty(element.DateComplete))
                {
                    date_notime = element.DateComplete.Split(' ');
                    element.DateComplete = date_notime[0];
                }
            }

            SelectCar.DataSource = CarID_Name.Values;
            SelectCar.DataBind();

            AssignedEmployee.DataSource = EmployeeID_Name.Values;
            AssignedEmployee.DataBind();

            TaskList.DataSource = tasks;
            TaskList.DataBind();
        }
Esempio n. 2
0
    void FixedUpdate()
    {
        speed += acceleration * Time.deltaTime;
        if (speed >= maxSpeed)
        {
            speed = maxSpeed;

            if (!ready)
            {
                ready = true;
                SelectCar.HideUnselected();
                playingUIInterpolator.Record();
                playingUIInterpolator.isPlaying = true;
            }
        }

        driver.location += speed * Time.deltaTime;

        int newScore = (((int)(driver.location)) / 10) * 10;

        if (newScore != score)
        {
            score          = newScore;
            scoreText.text = score.ToString() + "m";
        }

        SlideCar();
        SetCameraTransform();
        ManageBarriers();
    }
Esempio n. 3
0
    void OnMouseUp()
    {
        if (CloudVariables.Coins < 100)
        {
            Debug.Log("You can't buy this." + "You need to collect " + (100 - CloudVariables.Coins) + " more coins to buy this car.");

            if (PlayerPrefs.GetString("Music") != "off")
            {
                transform.GetChild(0).GetComponent <AudioSource>().Play();
            }
        }
        else
        {
            PlayerPrefs.SetString("Current car", carName.text);
            PlayerPrefs.SetString(carName.text, "Unlocked");

            PlayerPrefs.SetInt("CarLength", SelectCar.getLengthByName(carName.text));

            CloudVariables.Coins -= 100;
            GameObject.Find(carName.text).GetComponent <Animation> ().Play();
            coins.text = CloudVariables.Coins.ToString();
            //LoginGoogle.Instance.SaveData2();
            if (PlayerPrefs.GetString("Music") != "off")
            {
                Instantiate(buyCarAudio, new Vector3(0, 0, 0), Quaternion.identity);
            }
            selectBtn.SetActive(true);
            gameObject.SetActive(false);
        }
    }
Esempio n. 4
0
        public void getCarTest_noresponse()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>());
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "What's the make of the car?");
        }
Esempio n. 5
0
        private void BindData()
        {
            TaskBLL TaskBL = new TaskBLL(connectionString);
            Dictionary <int, string> CarID_Name      = TaskBL.GetNameListFromCarTable();
            Dictionary <int, string> EmployeeID_Name = TaskBL.GetNameListFromEmployeeTable();

            SelectCar.DataSource = CarID_Name.Values;
            SelectCar.DataBind();

            AssignedEmployee.DataSource = EmployeeID_Name.Values;
            AssignedEmployee.DataBind();
        }
Esempio n. 6
0
        public void getCarTest_nonsense()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "m", "University of the Texas at Arlington" },
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "I don't know at this time.");
        }
Esempio n. 7
0
        public void getCarTest_2nonmandatory()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Model", "Camry" },
                { "Year", "2012" },
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "What's the make of the car?");
        }
Esempio n. 8
0
        public void getCarTest_3badyr()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Acura" },
                { "Model", "ILX" },
                { "Year", "2012" }
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The ILX manufactured by Acura was first made in 2013. The last year the ILX was made was in 2016.");
        }
Esempio n. 9
0
        public void getCarTest_3good()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "BMW" },
                { "Model", "5 Series" },
                { "Year", "2014" }
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 5 Series manufactured by BMW was first made in 1990. The last year the 5 Series was made was in 2016.");
        }
Esempio n. 10
0
        public void getCarTest_3notfullyear()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Toyota" },
                { "Model", "Camry" },
                { "Year", "02" }
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The Camry manufactured by Toyota was first made in 1990. The last year the Camry was made was in 2016");
        }
Esempio n. 11
0
        public void getCarTest_3notfullmodel()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Mazda" },
                { "Model", "CX" },
                { "Year", "2014" }
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "I don't have that car in my records. Hm try again later.");
        }
Esempio n. 12
0
        public void getCarTest_3hyphen()
        {
            // User says Mercedes Benz. Should match against mercedes-benz
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Mercedes Benz" },
                { "Model", "S Class" },
                //   {"Year", "2012" }
            }
                                                     );
            var intent          = new SelectCar();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 5 Series manufactured by BMW was first made in 1994. The last year the 5 Series was made was in 2017.");
        }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        playerID = -1;
        DontDestroyOnLoad(this);

        GameObject obj = GameObject.Find("Canvas");

        obj = findChild(obj.transform, "WaitForItLabel");

        //if(obj!=null) Debug.Log("@@");
        WaitForIt = obj.GetComponent <Text> ();

        selectCarPanel = GameObject.Find("SelectCar");

        carSelection    = GameObject.Find("CarSelection");
        selectCarScript = carSelection.GetComponent <SelectCar> ();
        deSelectCar();
    }
Esempio n. 14
0
        public void SelectCare2()
        {
            // Arrange
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Dodge" },
                { "Model", "Dart" },
                { "Year", "2013" }
            }
                                                     );
            var intent     = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            // Assert.AreEqual("https://api.edmunds.com/api/vehicle/v2/Dodge/Dart/2013/styles?view=full&fmt=json&api_key=67t7jtrnvz8wyzgfpwgcqa3y", edmundsURL);

            var edmundsResponse = intent.GetEdmundsResponse();
            // Assert.AreEqual("Dodge Dart have 36", edmundsResponse);

            // Act

            // Assert
        }
	void Start () {
        instance = this;
	}