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; }
public ContestSelectedSongInfo(ContestInfo contestInfo) : base(SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(contestInfo.ScoreHash), contestInfo.Difficulty)) { ContestInfo = contestInfo; }
public void UpdateSongInfo() { SongInfo = SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(ContestInfo.ScoreHash), ContestInfo.Difficulty); }