Exemplo n.º 1
0
        /// <summary>
        /// The method work in thread. 
        /// Initialize random.
        /// Set random results.
        /// </summary>
        private void Run()
        {
            Thread.Sleep(250);

            DataRoulette data = new DataRoulette();
            data.InitializeRandom();
            this.RoulutteData = data;
        }
Exemplo n.º 2
0
        private void Load()
        {
            user = User.CurrentUser;

            dataRoulette = new DataRoulette();
            txtPoints.Text = "Points: " + user.CurrentPoints.ToString();

            txtUser.Text = user.NickName + " Level: " + user.Level;
        }
Exemplo n.º 3
0
        public void TestThread()
        {
            DataRoulette data = new DataRoulette();
            ThreadRoulette thread = new ThreadRoulette("Pasha's thread! Cool!");

            // Если раскоментить то все получиться) Урааа) круто)) ахха
            thread.Thrd.Join();

            Assert.IsNotNull(thread.RoulutteData);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Method is compare results in game
        /// </summary>
        /// <param name="data1">Data from thread 1</param>
        /// <param name="data2">Data from thread 2</param>
        /// <param name="data3">Data from thread 3</param>
        /// <returns>Return the total amount of points</returns>
        public int CompareResult(DataRoulette data1, DataRoulette data2, DataRoulette data3)
        {
            int res = 0;
            res += img.CheckImages(data1.Name, data2.Name, data3.Name);
            res += numb.CheckNumbers(data1.Number, data2.Number, data3.Number);

            // Value 100 that is jack point. The all images and numbers are same
            if (res == 100)
                return res + 100;

            res += (data1.Number + data2.Number + data3.Number) / 2;
            return res;
        }
Exemplo n.º 5
0
        public void TestData()
        {
            // Avarage
            DataRoulette data = new DataRoulette();
            //data.InitializeRandom();

            //var s = data.Name + data.Number + data.PathToImage;

            // Assert - check types of returns values 
            //Assert.AreEqual(data.Image, typeof(BitmapImage));
            //Assert.AreEqual(data.Name, typeof(string));
            //Assert.AreEqual(data.Number, typeof(int));
            //Assert.AreEqual(data.PathToImage, typeof(string));
        }