Exemple #1
0
        public HttpResponseMessage GetAnimal([FromUri] AnimalText animalText)
        {
            var           resp    = new HttpResponseMessage(HttpStatusCode.OK);
            StringBuilder builder = new StringBuilder();

            string animal;
            string description;
            string url;
            string loremText;

            if (animalText == null)
            {
                animalText = db.AnimalText.Find(1);

                animal      = animalText.AnimalName;
                description = "*" + animalText.AnimalDetails + "*";
                url         = "*" + animalText.Url + "*";
                loremText   = animalText.LoremText;

                builder.Append(animal).Append(description).Append(loremText).Append(url);

                string result2 = builder.ToString();
                resp.Content = new StringContent(result2, Encoding.UTF8, "text/plain");
                return(resp);
            }

            AnimalText animals = db.AnimalText.Find(animalText.AnimalId);

            if (animals == null)
            {
                animalText = db.AnimalText.Find(1);

                animal      = animalText.AnimalName;
                description = "*" + animalText.AnimalDetails + "*";
                url         = "*" + animalText.Url + "*";
                loremText   = animalText.LoremText;

                builder.Append(animal).Append(description).Append(loremText).Append(url);

                string result2 = builder.ToString();
                resp.Content = new StringContent(result2, Encoding.UTF8, "text/plain");
                return(resp);
            }
            animal      = animals.AnimalName;
            description = "*" + animals.AnimalDetails + "*";
            url         = "*" + animals.Url + "*";
            loremText   = animals.LoremText;

            builder.Append(animal).Append(description).Append(loremText).Append(url);

            string result = builder.ToString();

            resp.Content = new StringContent(result, Encoding.UTF8, "text/plain");
            return(resp);
        }
        public IActionResult GetAnimal([FromQuery] AnimalText animalText)
        {
            StringBuilder builder = new StringBuilder();

            string animal;
            string description;
            string url;
            string loremText;

            if (animalText == null)
            {
                animalText = db.AnimalText.Find(1);

                animal      = animalText.AnimalName;
                description = "*" + animalText.AnimalDetails + "*";
                url         = "*" + animalText.Url + "*";
                loremText   = animalText.LoremText;

                builder.Append(animal).Append(description).Append(loremText).Append(url);

                string result2 = builder.ToString();
                return(Content(result2));
            }

            AnimalText animals = db.AnimalText.Find(animalText.AnimalId);

            if (animals == null)
            {
                animalText = db.AnimalText.Find(1);

                animal      = animalText.AnimalName;
                description = "*" + animalText.AnimalDetails + "*";
                url         = "*" + animalText.Url + "*";
                loremText   = animalText.LoremText;

                builder.Append(animal).Append(description).Append(loremText).Append(url);

                string result2 = builder.ToString();
                return(Content(result2));
            }
            animal      = animals.AnimalName;
            description = "*" + animals.AnimalDetails + "*";
            url         = "*" + animals.Url + "*";
            loremText   = animals.LoremText;

            builder.Append(animal).Append(description).Append(loremText).Append(url);

            string result = builder.ToString();

            return(Content(result));
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public QuadrantGameScreen(QuadrantExcercises excercise)
            : base()
        {
            currentExcercise = excercise;
            this.startSnakeLength = 5;
            this.rabbitPercentage = 0.0f;
            this.mouseSpeed = 0;
            this.animalTextDraw = AnimalText.None;
            this.animalText = new List<Text>();
            this.targetScore = 1000;

            if (currentExcercise == QuadrantExcercises.NumbersOne)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Quadrant;
            }
            else if (currentExcercise == QuadrantExcercises.NumbersTwo)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Axes;
            }
            else if (currentExcercise == QuadrantExcercises.NumbersThree)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Axes;
                this.animalTextDraw = AnimalText.Quadrant;
            }
            else if (currentExcercise == QuadrantExcercises.PolarityOne)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Position;
            }
            else if (currentExcercise == QuadrantExcercises.PolarityTwo)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Axes;
            }
            else if (currentExcercise == QuadrantExcercises.PolarityThree)
            {
                this.snakeSpeed = 5;
                coordinateType = CoordinateDraw.Axes;
                this.animalTextDraw = AnimalText.Position;
            }

            //KinectInput.SetNewSpeechVocabulary(new Microsoft.Speech.Recognition.Choices("play", "pause"));
        }