Пример #1
0
 public bool MatchesUsers(Highscore score)
 {
     if (UsersMode != QueryMode.IGNORE) {
         bool includes = UsersMode == QueryMode.INCLUDE;
         return Users.Contains(score.UserId) == includes;
     }
     return true;
 }
Пример #2
0
 public bool MatchesTags(Highscore score)
 {
     if (TagsMode != QueryMode.IGNORE) {
         bool includes = TagsMode == QueryMode.INCLUDE;
         bool matches = true;
         foreach (string tag in score.Tags) {
             if (Tags.Contains(tag) != includes) {
                 matches = false;
             }
         }
         return matches;
     }
     return true;
 }
Пример #3
0
 private HighscoreTable GetTestTable()
 {
     Highscore h1 = new Highscore(validUserId);
     Highscore h2 = new Highscore(validUserId);
     Highscore h3 = new Highscore(validUserId);
     h1.Score = 70;
     h2.Score = 16;
     h3.Score = 20;
     HighscoreTable table = new HighscoreTable();
     table.Add(h1);
     table.Add(h2);
     table.Add(h3);
     return table;
 }
        public void DisplayHighscores(List <Highscore> highscores)
        {
            this.highscores = highscores;

            statusText.SetText("");
            ClearEntries();

            for (int i = 0; i < highscores.Count; i++)
            {
                int            rank  = i + 1;
                HighscoreEntry entry = Instantiate(entryPrefab, leaderboardContent).GetComponent <HighscoreEntry>();
                entry.Populate(rank, "", "");

                if (this.highscores.Count > i)
                {
                    Highscore highscore = this.highscores[i];
                    string    value     = this.sortByScore ? highscore.GetScore().ToString() : highscore.GetDistance().ToString();

                    entry.Populate(rank, highscore.GetName(), value);
                    entry.SetIcons(highscore.GetShip(), highscore.isVrMode());
                    entry.SetTextColourBasedOnRank(rank);
                }
            }
        }
Пример #5
0
 public bool Matches(Highscore score)
 {
     return MatchesUsers(score) && MatchesTags(score);
 }
Пример #6
0
 public void ConstructWithUIDAndValidTags()
 {
     Highscore score = new Highscore(validUserId, validTagsList);
 }
Пример #7
0
 public void ConstructWithUID()
 {
     Highscore score = new Highscore(validUserId);
     Assert.AreEqual(validUserId, score.UserId);
 }