Ejemplo n.º 1
0
    public void UpdateScore(GCScore s)
    {
        ScoreCollection col = GlobalCollection;

        switch (s.collection)
        {
        case GCCollectionType.GLOBAL:
            col = GlobalCollection;
            break;

        case GCCollectionType.FRIENDS:
            col = SocsialCollection;
            break;
        }



        Dictionary <int, GCScore> scoreDict = col.AllTimeScores;

        switch (s.timeSpan)
        {
        case GCBoardTimeSpan.ALL_TIME:
            scoreDict = col.AllTimeScores;
            break;

        case GCBoardTimeSpan.TODAY:
            scoreDict = col.TodayScores;
            break;

        case GCBoardTimeSpan.WEEK:
            scoreDict = col.WeekScores;
            break;
        }


        if (scoreDict.ContainsKey(s.GetRank()))
        {
            scoreDict[s.GetRank()] = s;
        }
        else
        {
            scoreDict.Add(s.GetRank(), s);
        }
    }
Ejemplo n.º 2
0
	public void UpdateScore(GCScore s) {

		ScoreCollection col = GlobalCollection;

		switch(s.collection) {
		case GCCollectionType.GLOBAL:
			col = GlobalCollection;
			break;
		case GCCollectionType.FRIENDS:
			col = SocsialCollection;
			break;
		}




		Dictionary<int, GCScore> scoreDict = col.AllTimeScores;

		switch(s.timeSpan) {
		case GCBoardTimeSpan.ALL_TIME:
			scoreDict = col.AllTimeScores;
			break;
		case GCBoardTimeSpan.TODAY:
			scoreDict = col.TodayScores;
			break;
		case GCBoardTimeSpan.WEEK:
			scoreDict = col.WeekScores;
			break;
		}


		if(scoreDict.ContainsKey(s.GetRank())) {
			scoreDict[s.GetRank()] = s;
		} else {
			scoreDict.Add(s.GetRank(), s);
		}
	}