Example #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();

            Background = new Background(this);

            Background.ChangeBackground("BackgroundTextureOne");
            SpriteManager.Add(Background);

            TextureManager = new Managers.ContentManager(this);

            /* Top Wall */
            SpriteManager.Add(new WallSprite(this, new Vector2(0, -HUD.Height / 2f), HUD.Width, 30));

            /* Left Wall */
            SpriteManager.Add(new WallSprite(this, new Vector2(-HUD.Width / 2f, 0), 30, HUD.Height));

            /* Right Wall */
            SpriteManager.Add(new WallSprite(this, new Vector2(HUD.Width / 2f - 15, 0), 30, HUD.Height));

            /* Bottom Wall */
            SpriteManager.Add(new WallSprite(this, new Vector2(0, HUD.Height / 2f - 15), HUD.Width, 30));


            ToolBox = new Display.ToolBox(this);
            HUD.HUDObjects.Add(ToolBox);
            Player = new Player(this);



            Prefabs.CreatePrefabs(this);

            SetupDebug();
        }
        // Вывод погоды
        public void WeatherToday()
        {
            WeatherPresenter.TodayWeatherSet();
            txtCityDay.Text = "Город: " + WeatherModel.City + '\n';
            DateTime dateValue = DateTime.Now;

            txtCityDay.Text += dateValue.Day + "." + dateValue.Month.ToString("00") + "." + dateValue.Year + "\n";
            txtCityDay.Text += dateValue.DayOfWeek.ToString() + "\n";
            txtResult.Text   = "Погодные условия: " + WeatherModel.Description + " \n";
            txtResult.Text  += "Температура: " + WeatherModel.Temperature;
            TemperatureUnits();
            txtResult.Text += "Мин. температура: " + WeatherModel.MinTemperature;
            TemperatureUnits();
            txtResult.Text += "Макс. температура: " + WeatherModel.MaxTemperature;
            TemperatureUnits();
            txtResult.Text += "Скорость ветра: " + WeatherModel.Speed;
            SpeedUnits();
            txtResult.Text += "Облачность: " + WeatherModel.Clouds + " %\n";
            txtResult.Text += "Давление: " + WeatherModel.Pressure + " Па\n";
            txtResult.Text += "Влажность: " + WeatherModel.Humidity + " %\n";

            this.BackgroundImage = Background.ChangeBackground();
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
        }
        // Вывод погоды
        public void WeatherToday()
        {
            WeatherPresenter.TodayWeatherSet();
            txtCityDay.Text = "City: " + WeatherModel.City + '\n';
            DateTime dateValue = DateTime.Now;

            txtCityDay.Text += dateValue.Day + "." + dateValue.Month.ToString("00") + "." + dateValue.Year + "\n";
            txtCityDay.Text += dateValue.DayOfWeek.ToString() + "\n";
            txtResult.Text   = "Weather Description: " + WeatherModel.Description + " \n";
            txtResult.Text  += "Temperature: " + WeatherModel.Temperature;
            TemperatureUnits();
            txtResult.Text += "Minimum temperature: " + WeatherModel.MinTemperature;
            TemperatureUnits();
            txtResult.Text += "Maximum temperature: " + WeatherModel.MaxTemperature;
            TemperatureUnits();
            txtResult.Text += "Wind Speed: " + WeatherModel.Speed;
            SpeedUnits();
            txtResult.Text += "Cloudiness: " + WeatherModel.Clouds + " %\n";
            txtResult.Text += "Pressure: " + WeatherModel.Pressure + " hPa\n";
            txtResult.Text += "Humidity: " + WeatherModel.Humidity + " %\n";

            this.BackgroundImage = Background.ChangeBackground();
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
        }
Example #4
0
    private IEnumerator NewLevelRoutine()
    {
        circleHits = 0;
        m_uiHandler.nextLevelButton.gameObject.SetActive(false);

        StartCoroutine(m_uiHandler.NewLevelScreen());

        yield return(new WaitForSeconds(.1f));

        levelCount = PlayerPrefs.GetInt("C_Level");
        levelCount++;
        PlayerPrefs.SetInt("C_Level", levelCount);

        HandleStart();
        m_background.ChangeBackground();
        m_ballScript.canShoot = true;
    }
        public void TomorrowShow()
        {
            txtResult.Text += "Погодные условия: " + WeatherModel.Description + '\n';
            txtResult.Text += "Температура: " + WeatherModel.Temperature;
            TemperatureUnits();
            txtResult.Text += "Скорость ветра: " + WeatherModel.Speed;
            SpeedUnits();
            txtResult.Text += "Облачность: " + WeatherModel.Clouds + " %\n";
            txtResult.Text += "Давление: " + WeatherModel.Pressure + " Па\n";
            txtResult.Text += "Влажность: " + WeatherModel.Humidity + " %\n";

            this.BackgroundImage = Background.ChangeBackground();

            // ChangeBackground(WeatherModel.TommorowShowIndex);
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
        }
        public void TomorrowShow()
        {
            txtResult.Text += "Weather description: " + WeatherModel.Description + '\n';
            txtResult.Text += "Temperature: " + WeatherModel.Temperature;
            TemperatureUnits();
            txtResult.Text += "Wind Speed: " + WeatherModel.Speed;
            SpeedUnits();
            txtResult.Text      += "Cloudiness: " + WeatherModel.Clouds + " %\n";
            txtResult.Text      += "Pressure: " + WeatherModel.Pressure + " hPa\n";
            txtResult.Text      += "Humidity: " + WeatherModel.Humidity + " %\n";
            txtResult.Text      += "Date: " + WeatherModel.Date + "\n\n";
            this.BackgroundImage = Background.ChangeBackground();

            // ChangeBackground(WeatherModel.TommorowShowIndex);
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
        }
Example #7
0
        /// <summary>
        /// Initialize gameplay variables
        /// </summary>
        /// <param name="beatmap"></param>
        private void InitializeGameplay(Beatmap beatmap)
        {
            Columns    = new Column[KeyCount];
            Judgements = new List <JudgementValue>();
            errors     = new List <KeyValuePair <double, int> >();
            rawInputs  = new List <KeyValuePair <double, int> >();
            bindings   = new Dictionary <Keys, int>();

            Combo           = 0;
            maxCombo        = 0;
            comboMultiplier = Scoring.MaxComboMultiplier;
            score           = 0;

            Background = new Background(Config.GetInt("Gameplay", "BackgroundDim") / 100f);
            Background.ChangeBackground(GraphicsUtils.LoadFileTexture(beatmap.Path + "/" + beatmap.Background));

            // Set the path of the song to be played later on
            AudioManager.songPath = beatmap.GetFullAudioPath();

            CurrentBeatmap = beatmap;
        }
Example #8
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent ();

            Background = new Background ( this );

            Background.ChangeBackground ( "BackgroundTextureOne" );
            SpriteManager.Add ( Background );

            TextureManager = new Managers.ContentManager ( this );

            /* Top Wall */
            SpriteManager.Add ( new WallSprite ( this, new Vector2 ( 0, -HUD.Height / 2f ), HUD.Width, 30 ) );

            /* Left Wall */
            SpriteManager.Add ( new WallSprite ( this, new Vector2 ( -HUD.Width / 2f, 0 ), 30, HUD.Height ) );

            /* Right Wall */
            SpriteManager.Add ( new WallSprite ( this, new Vector2 ( HUD.Width / 2f - 15, 0 ), 30, HUD.Height ) );

            /* Bottom Wall */
            SpriteManager.Add ( new WallSprite ( this, new Vector2 ( 0, HUD.Height / 2f - 15 ), HUD.Width, 30 ) );

            ToolBox = new Display.ToolBox ( this );
            HUD.HUDObjects.Add ( ToolBox );
            Player = new Player ( this );

            Prefabs.CreatePrefabs ( this );

            SetupDebug ();
        }
Example #9
0
 private void ChangeCurrentBackground(int index, string tag)
 {
     HideSub();
     _taskManager.AddTask(_background, _background.ChangeBackground(index), OnStep);
     SaveManager.Instance.SaveBackground(tag);
 }
        public void WeatherFiveDaysByHours()
        {
            labelindex      = 0;
            txtCityDay.Text = "City: " + WeatherModel.City + '\n';
            txtResult.Text  = "";
            txtRes.Text     = "";

            DateTime dateValue = DateTime.Now.AddDays(WeatherModel.FiveDaysHShowIndex - 1);

            txtCityDay.Text += dateValue.Day + "." + dateValue.Month.ToString("00") + "." + dateValue.Year + "\n";
            txtCityDay.Text += dateValue.DayOfWeek.ToString() + "\n\n";
            do
            {
                if (WeatherModel.Index == WeatherModel.Cnt)
                {
                    break;
                }
                label1.Text = WeatherModel.Date;
                String   value      = label1.Text;
                Char     delimiter  = ' ';
                String[] substrings = value.Split(delimiter);
                sub = substrings[0];

                if (sub == $"{DateTime.Now.AddDays(WeatherModel.FiveDaysHShowIndex - 1).ToString("yyyy-MM-dd")}")
                {
                    if (labelindex < 4)
                    {
                        txtResult.Text += label1.Text + "\n";
                        txtResult.Text += "Weather Description: " + WeatherModel.Description + '\n';
                        txtResult.Text += "Temperature: " + WeatherModel.Temperature;
                        TemperatureUnits();
                        txtResult.Text += "Wind Speed: " + WeatherModel.Speed;
                        SpeedUnits();
                        txtResult.Text += "Cloudiness: " + WeatherModel.Clouds + " %\n";
                        txtResult.Text += "Pressure: " + WeatherModel.Pressure + " hPa\n";
                        txtResult.Text += "Humidity: " + WeatherModel.Humidity + " %\n\n";
                    }
                    else
                    {
                        txtRes.Text += label1.Text + "\n";
                        txtRes.Text += "Weather Description: " + WeatherModel.Description + '\n';
                        txtRes.Text += "Temperature: " + WeatherModel.Temperature;
                        TemperatureUnits(txtRes);
                        txtRes.Text += "Wind Speed: " + WeatherModel.Speed;
                        SpeedUnits(txtRes);
                        txtRes.Text += "Cloudiness: " + WeatherModel.Clouds + "%\n";
                        txtRes.Text += "Pressure: " + WeatherModel.Pressure + " hPa\n";
                        txtRes.Text += "Humidity: " + WeatherModel.Humidity + "%\n\n";
                    }
                    //MessageBox.Show(sub);
                    //MessageBox.Show($"{DateTime.Now.AddDays(i-1).ToString("yyyy-MM-dd")}");
                    //label1.Text.StartsWith($"{DateTime.Now.Year}-{DateTime.Now.Month}-{DateTime.Now.Day}")
                    MessageBox.Show("Test " + Convert.ToString(WeatherModel.Index));
                    WeatherModel.Index++;
                    MessageBox.Show(Convert.ToString(WeatherModel.Index));
                }
                labelindex++;
            } while (sub == $"{DateTime.Now.AddDays(WeatherModel.FiveDaysHShowIndex - 1).ToString("yyyy-MM-dd")}");
            this.BackgroundImage = Background.ChangeBackground();

            //ChangeBackground(WeatherModel.FiveDaysHShowIndex);
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
        }
        public void WeatherFiveDays()
        {
            txtCityDay.Text = "City: " + WeatherModel.City + '\n';
            txtResult.Text  = "";

            DateTime dateValue = DateTime.Now.AddDays(WeatherModel.FiveDaysShowIndex - 1);

            txtCityDay.Text += dateValue.Day + "." + dateValue.Month.ToString("00") + "." + dateValue.Year + "\n";
            txtCityDay.Text += dateValue.DayOfWeek.ToString() + "\n\n";

            float temperature = 0, windspeed = 0, cloudiness = 0, pressure = 0, humidity = 0, min = 0, max = 0;

            do // Сумма всех показателей (чтобы в дальнейшем найти среднее значение)
            {
                //MessageBox.Show(Convert.ToString(WeatherModel.Cnt));
                //MessageBox.Show(Convert.ToString(WeatherModel.IndexFiveDays));

                if (WeatherModel.IndexFiveDays == WeatherModel.Cnt)
                {
                    break;
                }

                label1.Text = WeatherModel.Date;
                String   value      = label1.Text;
                Char     delimiter  = ' ';
                String[] substrings = value.Split(delimiter);
                sub = substrings[0];

                if (sub == $"{DateTime.Now.AddDays(WeatherModel.FiveDaysShowIndex - 1).ToString("yyyy-MM-dd")}")
                {
                    WeatherPresenter.FiveDaysWeatherSet();
                    temperature += WeatherModel.Temperature;
                    windspeed   += WeatherModel.Speed;
                    cloudiness  += WeatherModel.Clouds;
                    pressure    += WeatherModel.Pressure;
                    humidity    += WeatherModel.Humidity;
                    min         += WeatherModel.MinTemperature;
                    max         += WeatherModel.MaxTemperature;

                    //MessageBox.Show($"{DateTime.Now.AddDays(i-1).ToString("yyyy-MM-dd")}");
                    //label1.Text.StartsWith($"{DateTime.Now.Year}-{DateTime.Now.Month}-{DateTime.Now.Day}")

                    WeatherModel.IndexFiveDays++;
                    iter++;
                }
            } while (sub == $"{DateTime.Now.AddDays(WeatherModel.FiveDaysShowIndex - 1).ToString("yyyy-MM-dd")}");

            txtResult.Text += "Weather Description: " + WeatherModel.Description + '\n';
            txtResult.Text += "Minimum temperature: " + Math.Round(min / iter, 2);
            TemperatureUnits();
            txtResult.Text += "Maximum temperature: " + Math.Round(max / iter, 2);
            TemperatureUnits();
            txtResult.Text += "Wind Speed: " + Math.Round(windspeed / iter, 2);
            SpeedUnits();
            txtResult.Text += "Cloudiness: " + Math.Round(cloudiness / iter, 1) + " %\n";
            txtResult.Text += "Pressure: " + Math.Round(pressure / iter, 0) + " hPa\n";
            txtResult.Text += "Humidity: " + Math.Round(humidity / iter, 0) + " %\n\n";

            this.BackgroundImage = Background.ChangeBackground();

            // ChangeBackground(WeatherModel.FiveDaysShowIndex);
            string picture = WeatherModel.Picture;

            pictureBox1.Load($"http://openweathermap.org/img/w/{picture}.png");
            iter = 0;
        }