Beispiel #1
0
            public ReplayComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ReplayInfo replay, SongInformation songInfo, WebSongInformation webSongInfo, Difficulty difficulty) : base(device)
            {
                this.resourceManager = resourceManager;
                Replay      = replay;
                SongInfo    = songInfo;
                WebSongInfo = webSongInfo;
                Difficulty  = difficulty;

                var color = songInfo == null ? PPDColors.Gray : PPDColors.White;

                AddChild(new TextureString(device, String.Format("{0}[{1}]", songInfo == null ? webSongInfo.Title : songInfo.DirectoryName, difficulty), 20, 400, color)
                {
                    AllowScroll = true
                });
                this.AddChild(new TextureString(device, replay.Nickname, 20, 300, color)
                {
                    AllowScroll = true,
                    Position    = new Vector2(700, 0),
                    Alignment   = Alignment.Right
                });
                AddChild(new TextureString(device, String.Format("{0}:{1} C{2} G{3} SF{4} SD{5} W{6} MC{7}", Utility.Language["Score2"], replay.Score,
                                                                 replay.CoolCount, replay.GoodCount, replay.SafeCount, replay.SadCount, replay.WorstCount, replay.MaxCombo), 16, 700, color)
                {
                    Position    = new Vector2(0, 26),
                    AllowScroll = true
                });
            }
Beispiel #2
0
 public UpdatableScoreGameCompoennt(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, WebSongInformation songInformation) : base(device)
 {
     this.resourceManager = resourceManager;
     this.songInformation = songInformation;
     this.AddChild(new StackObject(device,
                                   songInfoText = new TextureString(device, songInformation.Title, 18, PPDColors.White),
                                   new SpaceObject(device, 5, 1),
                                   stateText = new TextureString(device, "", 18, PPDColors.White))
     {
         IsHorizontal = true
     });
     UpdateStateText();
 }
Beispiel #3
0
        public void AddPerfectTrial(string scoreHash)
        {
            WebSongInformation webSongInfo = WebSongInformationManager.Instance[scoreHash];

            if (webSongInfo == null)
            {
                return;
            }

            if (!trials.TryGetValue(webSongInfo.Hash, out List <PerfectTrialInfo> trialList))
            {
                trialList = new List <PerfectTrialInfo>();
                trials[webSongInfo.Hash] = trialList;
            }
            var diff = webSongInfo.Difficulties.FirstOrDefault(d => d.Hash == scoreHash);

            trialList.Add(new PerfectTrialInfo(-1, webSongInfo.Hash, scoreHash, diff == null ? Difficulty.Easy : diff.Difficulty));
        }
Beispiel #4
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;
        }
Beispiel #5
0
        public bool IsPerfect(string scoreHash)
        {
            WebSongInformation webSongInfo = WebSongInformationManager.Instance[scoreHash];

            if (webSongInfo == null)
            {
                return(false);
            }
            if (trials.TryGetValue(webSongInfo.Hash, out List <PerfectTrialInfo> perfectTrials))
            {
                var found = perfectTrials.FirstOrDefault(p => p.ScoreHash == scoreHash);
                if (found != null)
                {
                    return(true);
                }
                Difficulty targetDifficulty = Difficulty.Other;
                foreach (var diff in webSongInfo.Difficulties)
                {
                    if (diff.Hash == scoreHash)
                    {
                        targetDifficulty = diff.Difficulty;
                        break;
                    }
                }
                foreach (var diff in webSongInfo.Difficulties)
                {
                    if (diff.Difficulty == targetDifficulty)
                    {
                        found = perfectTrials.FirstOrDefault(p => p.ScoreHash == diff.Hash);
                        if (found != null)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
 public ActiveScoreSelectedSongInfo(WebSongInformation activeScore)
     : base(activeScore.GetSongInformation())
 {
     ActiveScore = activeScore;
 }