Exemplo n.º 1
0
        public SetBasedScore GetScore(GuessSetBased master)
        {
            SetBasedScore score = new SetBasedScore();

            int setIndex = 0;
            int songIndex = 0;

            ISet retSet;
            double scoreCount = 0;
            
            foreach (var set in master.SongList.Sets)
            {
                retSet = new Set();
                scoreCount = 0;

                setIndex = master.SongList.Sets.IndexOf(set);
                
                foreach (var song in set.Key.SongList)
                {
                   songIndex = set.Key.SongList.IndexOf(song);

                   var songPair = new KeyValuePair<ISong, SongNote>(song.Key, song.Value);

                   retSet.SongList.Add(songPair);

                   if (SongList.Sets[setIndex].Key.SongList[songIndex].Key.SongIsEqual(song.Key))
                   {
                       scoreCount += RightSongRightSpot;

                       var songNote = SongList.Sets[setIndex].Key.SongList[songIndex].Value;

                       if (songNote == SongNote.Into && songNote == song.Value)
                       {
                           scoreCount += IntoCorrect;
                       }
                       else if(songNote == SongNote.Into && songNote != song.Value)
                       {
                           scoreCount -= IntoWrong;
                       }
                   }
                   else if (SongList.Sets[setIndex].Key.ContainsSong(song.Key))
                   {
                       scoreCount += RightSongSameSet;
                   }
                   else
                   {
                       scoreCount -= WrongSong;
                   }
                }

                score.AddSet(retSet, scoreCount);
            }

            return score;
        }
Exemplo n.º 2
0
        public SetBasedScore GetScore(GuessSetBased master)
        {
            SetBasedScore score = new SetBasedScore();

            int setIndex  = 0;
            int songIndex = 0;

            ISet   retSet;
            double scoreCount = 0;

            foreach (var set in master.SongList.Sets)
            {
                retSet     = new Set();
                scoreCount = 0;

                setIndex = master.SongList.Sets.IndexOf(set);

                foreach (var song in set.Key.SongList)
                {
                    songIndex = set.Key.SongList.IndexOf(song);

                    var songPair = new KeyValuePair <ISong, SongNote>(song.Key, song.Value);

                    retSet.SongList.Add(songPair);

                    if (SongList.Sets[setIndex].Key.SongList[songIndex].Key.SongIsEqual(song.Key))
                    {
                        scoreCount += RightSongRightSpot;

                        var songNote = SongList.Sets[setIndex].Key.SongList[songIndex].Value;

                        if (songNote == SongNote.Into && songNote == song.Value)
                        {
                            scoreCount += IntoCorrect;
                        }
                        else if (songNote == SongNote.Into && songNote != song.Value)
                        {
                            scoreCount -= IntoWrong;
                        }
                    }
                    else if (SongList.Sets[setIndex].Key.ContainsSong(song.Key))
                    {
                        scoreCount += RightSongSameSet;
                    }
                    else
                    {
                        scoreCount -= WrongSong;
                    }
                }

                score.AddSet(retSet, scoreCount);
            }

            return(score);
        }