Esempio n. 1
0
 private void PopulateStaticData()
 {
   this.m_Friends.Add(new UserProfile("Fred", "1001", true, UserState.Online, this.m_DefaultTexture));
   this.m_Friends.Add(new UserProfile("Julia", "1002", true, UserState.Online, this.m_DefaultTexture));
   this.m_Friends.Add(new UserProfile("Jeff", "1003", true, UserState.Online, this.m_DefaultTexture));
   this.m_Users.Add(new UserProfile("Sam", "1004", false, UserState.Offline, this.m_DefaultTexture));
   this.m_Users.Add(new UserProfile("Max", "1005", false, UserState.Offline, this.m_DefaultTexture));
   this.m_AchievementDescriptions.Add(new AchievementDescription("Achievement01", "First achievement", this.m_DefaultTexture, "Get first achievement", "Received first achievement", false, 10));
   this.m_AchievementDescriptions.Add(new AchievementDescription("Achievement02", "Second achievement", this.m_DefaultTexture, "Get second achievement", "Received second achievement", false, 20));
   this.m_AchievementDescriptions.Add(new AchievementDescription("Achievement03", "Third achievement", this.m_DefaultTexture, "Get third achievement", "Received third achievement", false, 15));
   Leaderboard leaderboard = new Leaderboard();
   leaderboard.SetTitle("High Scores");
   leaderboard.id = "Leaderboard01";
   leaderboard.SetScores((IScore[]) new List<Score>()
   {
     new Score("Leaderboard01", 300L, "1001", DateTime.Now.AddDays(-1.0), "300 points", 1),
     new Score("Leaderboard01", (long) byte.MaxValue, "1002", DateTime.Now.AddDays(-1.0), "255 points", 2),
     new Score("Leaderboard01", 55L, "1003", DateTime.Now.AddDays(-1.0), "55 points", 3),
     new Score("Leaderboard01", 10L, "1004", DateTime.Now.AddDays(-1.0), "10 points", 4)
   }.ToArray());
   this.m_Leaderboards.Add(leaderboard);
 }
Esempio n. 2
0
 private void SetLocalPlayerScore(Leaderboard board)
 {
   foreach (Score score in board.scores)
   {
     if (score.userID == this.localUser.id)
     {
       board.SetLocalUserScore((IScore) score);
       break;
     }
   }
 }
Esempio n. 3
0
 private void SortScores(Leaderboard board)
 {
   List<Score> scoreList = new List<Score>((IEnumerable<Score>) board.scores);
   scoreList.Sort((Comparison<Score>) ((s1, s2) => s2.value.CompareTo(s1.value)));
   for (int index = 0; index < scoreList.Count; ++index)
     scoreList[index].SetRank(index + 1);
 }
Esempio n. 4
0
 private void SortScores(Leaderboard board)
 {
     List<Score> list = new List<Score>((Score[]) board.scores);
     if (<>f__am$cache7 == null)
     {
Esempio n. 5
0
		private void SetLocalPlayerScore(Leaderboard board)
		{
			IScore[] scores = board.scores;
			for (int i = 0; i < scores.Length; i++)
			{
				Score score = (Score)scores[i];
				if (score.userID == this.localUser.id)
				{
					board.SetLocalUserScore(score);
					break;
				}
			}
		}
Esempio n. 6
0
		private void SortScores(Leaderboard board)
		{
			List<Score> list = new List<Score>((Score[])board.scores);
			list.Sort((Score s1, Score s2) => s2.value.CompareTo(s1.value));
			for (int i = 0; i < list.Count; i++)
			{
				list[i].SetRank(i + 1);
			}
		}