public void Refresh() { SocsialCollection = new GK_ScoreCollection(); GlobalCollection = new GK_ScoreCollection(); CurrentPlayerScore = new List<GK_Score>(); ScoreUpdateListners = new Dictionary<int, GK_LocalPlayerScoreUpdateListener>(); }
public void Refresh() { SocsialCollection = new GK_ScoreCollection(); GlobalCollection = new GK_ScoreCollection(); CurrentPlayerScore = new List <GK_Score>(); ScoreUpdateListners = new Dictionary <int, GK_LocalPlayerScoreUpdateListener>(); }
public GK_Score GetScore(int rank, GK_TimeSpan scope, GK_CollectionType collection) { GK_ScoreCollection col = GlobalCollection; switch (collection) { case GK_CollectionType.GLOBAL: col = GlobalCollection; break; case GK_CollectionType.FRIENDS: col = SocsialCollection; break; } Dictionary <int, GK_Score> scoreDict = col.AllTimeScores; switch (scope) { case GK_TimeSpan.ALL_TIME: scoreDict = col.AllTimeScores; break; case GK_TimeSpan.TODAY: scoreDict = col.TodayScores; break; case GK_TimeSpan.WEEK: scoreDict = col.WeekScores; break; } if (scoreDict.ContainsKey(rank)) { return(scoreDict[rank]); } else { return(null); } }
public void UpdateScore(GK_Score s) { GK_ScoreCollection col = GlobalCollection; switch (s.Collection) { case GK_CollectionType.GLOBAL: col = GlobalCollection; break; case GK_CollectionType.FRIENDS: col = SocsialCollection; break; } Dictionary <int, GK_Score> scoreDict = col.AllTimeScores; switch (s.TimeSpan) { case GK_TimeSpan.ALL_TIME: scoreDict = col.AllTimeScores; break; case GK_TimeSpan.TODAY: scoreDict = col.TodayScores; break; case GK_TimeSpan.WEEK: scoreDict = col.WeekScores; break; } if (scoreDict.ContainsKey(s.Rank)) { scoreDict[s.Rank] = s; } else { scoreDict.Add(s.Rank, s); } }
public List <GK_Score> GetScoresList(GK_TimeSpan timeSpan, GK_CollectionType collection) { GK_ScoreCollection col = GlobalCollection; switch (collection) { case GK_CollectionType.GLOBAL: col = GlobalCollection; break; case GK_CollectionType.FRIENDS: col = SocsialCollection; break; } Dictionary <int, GK_Score> scoreDict = col.AllTimeScores; switch (timeSpan) { case GK_TimeSpan.ALL_TIME: scoreDict = col.AllTimeScores; break; case GK_TimeSpan.TODAY: scoreDict = col.TodayScores; break; case GK_TimeSpan.WEEK: scoreDict = col.WeekScores; break; } List <GK_Score> scores = new List <GK_Score>(); scores.AddRange(scoreDict.Values); return(scores); }