Ejemplo n.º 1
0
        private void Generate()
        {
            mainSprite.ClearChildren();
            int iter = 0;

            foreach (var replay in replays)
            {
                var songInfo = SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(replay.ScoreHash));
                WebSongInformation webSongInfo = null;
                Difficulty         difficulty  = Difficulty.Other;
                if (songInfo == null)
                {
                    webSongInfo = WebSongInformationManager.Instance[replay.ScoreHash];
                    if (webSongInfo == null)
                    {
                        continue;
                    }
                    var diff = webSongInfo.Difficulties.FirstOrDefault(w => w.Hash == replay.ScoreHash);
                    if (diff != null)
                    {
                        songInfo   = webSongInfo.GetSongInformation();
                        difficulty = diff.Difficulty;
                    }
                }
                else
                {
                    if (songInfo != null)
                    {
                        difficulty = songInfo.GetDifficulty(replay.ScoreHash);
                    }
                }
                var control = new ReplayComponent(device, resourceManager, replay, songInfo, webSongInfo, difficulty)
                {
                    Position = new Vector2(0, iter * ItemHeight)
                };
                mainSprite.AddChild(control);
                iter++;
            }
            rectangle.Hidden   = !(mainSprite.ChildrenCount > 0);
            rectangle.Position = mainSprite.Position;
            selection          = 0;
        }
Ejemplo n.º 2
0
 public ContestSelectedSongInfo(ContestInfo contestInfo)
     : base(SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(contestInfo.ScoreHash), contestInfo.Difficulty))
 {
     ContestInfo = contestInfo;
 }
Ejemplo n.º 3
0
 public void UpdateSongInfo()
 {
     SongInfo = SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(ContestInfo.ScoreHash), ContestInfo.Difficulty);
 }