Ejemplo n.º 1
0
 /// <summary>
 /// 難易度の追加を終了したときに使用します。
 /// </summary>
 public void CheckNewOrCanUpdate()
 {
     IsNew     = true;
     CanUpdate = false;
     foreach (WebSongInformationDifficulty difficulty in difficulties)
     {
         var songInfo = SongInformation.FindSongInformationByHash(difficulty.HashAsBytes);
         if (songInfo != null)
         {
             IsNew      = false;
             CanUpdate |= difficulty.Revision < Revision;
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 対応するSongInformationを取得します。
        /// </summary>
        /// <returns>対応するSongInformation。</returns>
        public SongInformation GetSongInformation()
        {
            foreach (WebSongInformationDifficulty difficulty in difficulties)
            {
                var songInfo = SongInformation.FindSongInformationByHash(difficulty.HashAsBytes);
                if (songInfo != null)
                {
                    if (difficulty.Revision <= Revision)
                    {
                        return(songInfo);
                    }
                }
            }

            return(null);
        }
Ejemplo n.º 3
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.º 4
0
 public ContestSelectedSongInfo(ContestInfo contestInfo)
     : base(SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(contestInfo.ScoreHash), contestInfo.Difficulty))
 {
     ContestInfo = contestInfo;
 }
Ejemplo n.º 5
0
 public void UpdateSongInfo()
 {
     SongInfo = SongInformation.FindSongInformationByHash(CryptographyUtility.Parsex2String(ContestInfo.ScoreHash), ContestInfo.Difficulty);
 }