Example #1
0
        public RankingView()
        {
            songsList     = Audio.GetSongList();
            songViewsList = new List <SongView>();

            string h1 = "Im udało się uciec";
            string h2 = "Wybierz piosenke, aby przejsc do rankingu.";

            Elements.Add("H1", new ViewElement(Console.WindowWidth / 2 - h1.Length / 2, 3, h2.Length, 1, new List <string>()
            {
                h1
            }));
            Elements.Add("H2", new ViewElement(5, 5, h2.Length, 1, new List <string>()
            {
                h2
            }));

            Audio.StartServiceTrack("rank");

            int y = 7;

            foreach (Song song in songsList)
            {
                songViewsList.Add(new SongView(10, y, Console.WindowWidth - 20, song));
                y += 5;
            }

            selectedSong = songViewsList[0];
            selectedSong.SetTick();
        }
Example #2
0
        public SongSelectionView(string _nickname)
        {
            pressedKey = new ConsoleKeyInfo();
            songsList  = Audio.GetSongList();
            nickname   = _nickname;
            int x = Console.WindowWidth / 2 + 1;
            int y = 0;

            foreach (Song song in songsList)
            {
                songViewsList.Add(new SongView(x, y, Console.WindowWidth / 2, song));
                y += 5;
            }

            selectedSong = songViewsList[0];
        }