/// <summary> /// Updates the object and its contained resources. /// </summary> /// <param name="gameTime"/> public void Update(GameTime gameTime) { Session.UpdateSession(); if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null && _currentlyLoadingLeaderboardPage.PopulationState != LeaderboardPopulationState.LPS_PENDING) { bool success = _currentlyLoadingLeaderboardPage.PopulationState == LeaderboardPopulationState.LPS_POPULATED; _currentlyLoadingLeaderboardPage = null; if (_leaderboardPageLoadDelegate != null) { _leaderboardPageLoadDelegate.Invoke(success); } } if (_currentlyLoadingUserScores != null && _currentlyLoadingUserScores.PopulationState != LeaderboardPopulationState.LPS_PENDING) { CoLeaderboardUserRows scores = _currentlyLoadingUserScores; _currentlyLoadingUserScores = null; if (_userScoresLoadDelegate != null) { _userScoresLoadDelegate.Invoke(scores.PopulationState == LeaderboardPopulationState.LPS_POPULATED ? scores : null); } } } }
public void RequestUserPage(CoLeaderboardPage page, LeaderboardPageLoadDelegate pageCompleteDelegate) { if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null) { throw new Exception("Previous leaderboard page request still being processed"); } _leaderboardPageLoadDelegate = pageCompleteDelegate; _currentlyLoadingLeaderboardPage = page; page.RequestUserPage(Session.UserId); } }
public CoLeaderboardPage RequestOpenLeaderboard(int leaderboardId, int pageSize, LeaderboardPageLoadDelegate pageCompleteDelegate) { if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null) { throw new Exception("Previous leaderboard page request still being processed"); } _leaderboardPageLoadDelegate = pageCompleteDelegate; _currentlyLoadingLeaderboardPage = _leaderboardsManager.GetLeaderboardFromId(leaderboardId).GetGlobalPage((uint)pageSize); return(_currentlyLoadingLeaderboardPage); } return(null); }
public void RequestUserPage(CoLeaderboardPage page, LeaderboardPageLoadDelegate pageCompleteDelegate) { if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null) throw new Exception("Previous leaderboard page request still being processed"); _leaderboardPageLoadDelegate = pageCompleteDelegate; _currentlyLoadingLeaderboardPage = page; page.RequestUserPage(Session.UserId); } }
public CoLeaderboardPage RequestOpenLeaderboard(int leaderboardId, int pageSize, LeaderboardPageLoadDelegate pageCompleteDelegate) { if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null) throw new Exception("Previous leaderboard page request still being processed"); _leaderboardPageLoadDelegate = pageCompleteDelegate; _currentlyLoadingLeaderboardPage = _leaderboardsManager.GetLeaderboardFromId(leaderboardId).GetGlobalPage((uint) pageSize); return _currentlyLoadingLeaderboardPage; } return null; }
/// <summary> /// Updates the object and its contained resources. /// </summary> /// <param name="gameTime"/> public void Update(GameTime gameTime) { Session.UpdateSession(); if (SessionActive) { if (_currentlyLoadingLeaderboardPage != null && _currentlyLoadingLeaderboardPage.PopulationState != LeaderboardPopulationState.LPS_PENDING) { bool success = _currentlyLoadingLeaderboardPage.PopulationState == LeaderboardPopulationState.LPS_POPULATED; _currentlyLoadingLeaderboardPage = null; if (_leaderboardPageLoadDelegate != null) _leaderboardPageLoadDelegate.Invoke(success); } if (_currentlyLoadingUserScores != null && _currentlyLoadingUserScores.PopulationState != LeaderboardPopulationState.LPS_PENDING) { CoLeaderboardUserRows scores = _currentlyLoadingUserScores; _currentlyLoadingUserScores = null; if (_userScoresLoadDelegate != null) _userScoresLoadDelegate.Invoke(scores.PopulationState == LeaderboardPopulationState.LPS_POPULATED ? scores : null); } } }