本文整理汇总了Java中com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer类的典型用法代码示例。如果您正苦于以下问题:Java LeaderboardScoreBuffer类的具体用法?Java LeaderboardScoreBuffer怎么用?Java LeaderboardScoreBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LeaderboardScoreBuffer类属于com.google.android.gms.games.leaderboard包,在下文中一共展示了LeaderboardScoreBuffer类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: z
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public Leaderboards.LoadScoresResult z(final Status paramStatus)
{
return new Leaderboards.LoadScoresResult()
{
public Leaderboard getLeaderboard()
{
return null;
}
public LeaderboardScoreBuffer getScores()
{
return new LeaderboardScoreBuffer(DataHolder.empty(14));
}
public Status getStatus()
{
return paramStatus;
}
public void release()
{
}
};
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:25,代码来源:fw.java
示例2: aj
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
aj(DataHolder arg2)
{
super(localObject1, localDataHolder);
this.jY = new Status(localDataHolder.getStatusCode());
LeaderboardScoreBuffer localLeaderboardScoreBuffer = new LeaderboardScoreBuffer(localDataHolder);
try
{
if (localLeaderboardScoreBuffer.getCount() > 0)
this.uq = ((d)localLeaderboardScoreBuffer.get(0).freeze());
else
this.uq = null;
return;
}
finally
{
localLeaderboardScoreBuffer.close();
}
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:19,代码来源:fl.java
示例3: s
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
s(DataHolder paramDataHolder1, DataHolder arg3)
{
super(paramDataHolder1, localDataHolder2);
DataHolder localDataHolder1;
LeaderboardBuffer localLeaderboardBuffer = new LeaderboardBuffer(localDataHolder1);
try
{
if (localLeaderboardBuffer.getCount() > 0)
this.uh = ((com.google.android.gms.games.leaderboard.a)((Leaderboard)localLeaderboardBuffer.get(0)).freeze());
else
this.uh = null;
}
finally
{
localLeaderboardBuffer.close();
}
this.ui = new LeaderboardScoreBuffer(localDataHolder2);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:19,代码来源:fl.java
示例4: MainActivity
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public MainActivity() {
aHelper = new GameHelper(this);
aHelper.enableDebugLog(true, "MYTAG");
// create a listener for getting raw data back from leaderboard
theLeaderboardListener = new OnLeaderboardScoresLoadedListener() {
@Override
public void onLeaderboardScoresLoaded(int statusCode,
LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores) {
for (int i = 0; i < scores.getCount(); i++) {
System.out.println(scores.get(i)
.getScoreHolderDisplayName()
+ " : "
+ scores.get(i).getDisplayScore());
}
}
};
}
开发者ID:bitbrain,项目名称:plox,代码行数:21,代码来源:MainActivity.java
示例5: scoresToJsonString
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
private String scoresToJsonString( LeaderboardScoreBuffer scores ) {
int scoresNb = scores.getCount();
JSONArray jsonScores = new JSONArray();
for ( int i = 0; i < scoresNb; ++i ) {
LeaderboardScore score = scores.get(i);
JSONObject jsonScore = new JSONObject();
try {
jsonScore.put("value", score.getRawScore());
jsonScore.put("rank", score.getRank());
Player player = score.getScoreHolder();
JSONObject jsonPlayer = new JSONObject();
jsonPlayer.put("id", player.getPlayerId());
jsonPlayer.put("displayName", player.getDisplayName());
jsonPlayer.put("picture", player.getIconImageUri());
jsonScore.put("player", jsonPlayer);
jsonScores.put( jsonScore );
} catch( JSONException e ) {}
}
return jsonScores.toString();
}
开发者ID:freshplanet,项目名称:ANE-Google-Play-Game-Services,代码行数:27,代码来源:ExtensionContext.java
示例6: MainActivity
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public MainActivity() {
aHelper = new GameHelper(this);
aHelper.enableDebugLog(true, "MYTAG");
// create a listener for getting raw data back from leaderboard
theLeaderboardListener = new OnLeaderboardScoresLoadedListener() {
@Override
public void onLeaderboardScoresLoaded(int statusCode,
LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores) {
System.out.println("In call back");
for (int i = 0; i < scores.getCount(); i++) {
System.out.println(scores.get(i)
.getScoreHolderDisplayName()
+ " : "
+ scores.get(i).getDisplayScore());
}
}
};
}
开发者ID:bitbrain,项目名称:acid-snake,代码行数:22,代码来源:MainActivity.java
示例7: loadMoreScores
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
@Deprecated
public final void loadMoreScores(final OnLeaderboardScoresLoadedListener paramOnLeaderboardScoresLoadedListener, LeaderboardScoreBuffer paramLeaderboardScoreBuffer, int paramInt1, int paramInt2)
{
this.te.a(new a.c()
{
public void a(Leaderboards.LoadScoresResult paramAnonymousLoadScoresResult)
{
int i = paramAnonymousLoadScoresResult.getStatus().getStatusCode();
paramOnLeaderboardScoresLoadedListener.onLeaderboardScoresLoaded(i, paramAnonymousLoadScoresResult.getLeaderboard(), paramAnonymousLoadScoresResult.getScores());
}
}
, paramLeaderboardScoreBuffer, paramInt1, paramInt2);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:14,代码来源:GamesClient.java
示例8: loadMoreScores
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public final PendingResult<Leaderboards.LoadScoresResult> loadMoreScores(GoogleApiClient paramGoogleApiClient, final LeaderboardScoreBuffer paramLeaderboardScoreBuffer, final int paramInt1, final int paramInt2)
{
return paramGoogleApiClient.a(new c(paramLeaderboardScoreBuffer)
{
protected void a(fl paramAnonymousfl)
{
paramAnonymousfl.a(this, paramLeaderboardScoreBuffer, paramInt1, paramInt2);
}
});
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fw.java
示例9: a
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public final void a(a.c<Leaderboards.LoadScoresResult> paramc, LeaderboardScoreBuffer paramLeaderboardScoreBuffer, int paramInt1, int paramInt2)
{
// Byte code:
// 0: aload_0
// 1: invokevirtual 149 com/google/android/gms/internal/fl:bQ ()Landroid/os/IInterface;
// 4: checkcast 151 com/google/android/gms/internal/fp
// 7: new 296 com/google/android/gms/internal/fl$r
// 10: dup
// 11: aload_0
// 12: aload_1
// 13: invokespecial 297 com/google/android/gms/internal/fl$r:<init> (Lcom/google/android/gms/internal/fl;Lcom/google/android/gms/common/api/a$c;)V
// 16: aload_2
// 17: invokevirtual 303 com/google/android/gms/games/leaderboard/LeaderboardScoreBuffer:dq ()Lcom/google/android/gms/games/leaderboard/c;
// 20: invokevirtual 309 com/google/android/gms/games/leaderboard/c:dr ()Landroid/os/Bundle;
// 23: iload_3
// 24: iload 4
// 26: invokeinterface 312 5 0
// 31: return
// 32: ldc 169
// 34: ldc_w 256
// 37: invokestatic 259 com/google/android/gms/internal/fn:c (Ljava/lang/String;Ljava/lang/String;)V
// 40: return
//
// Exception table:
// from to target type
// 0 31 32 android/os/RemoteException
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:28,代码来源:fl.java
示例10: loadTopScores
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public void loadTopScores(String leaderboardId, int span,
int leaderboardCollection, int maxResults, boolean forceReload) {
Games.Leaderboards.loadTopScores(mGoogleApiClient, leaderboardId, span,
leaderboardCollection, maxResults, forceReload)
.setResultCallback(
new ResultCallback<Leaderboards.LoadScoresResult>() {
@Override
public void onResult(
Leaderboards.LoadScoresResult loadScoresResult) {
Leaderboard leaderboard = loadScoresResult
.getLeaderboard();
LeaderboardScoreBuffer buffer = loadScoresResult
.getScores();
String jsonString = "{\""
+ leaderboard.getDisplayName()
+ "\":\""
+ buffer.get(0).getDisplayScore()
+ "\"}";
JSONObject json = null;
try {
json = new JSONObject(jsonString);
} catch (JSONException e) {
e.printStackTrace();
Log.e(TAG, e.getLocalizedMessage());
}
if (mCallback != null) {
mCallback.onLoadTopScores(
ActionType.TOP_SCORES, json);
}
}
});
}
开发者ID:sadisasha,项目名称:PlayGames,代码行数:33,代码来源:PlayGamesServices.java
示例11: onResult
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public void onResult( Leaderboards.LoadScoresResult scoresResult ) {
LeaderboardScoreBuffer scores = scoresResult.getScores();
if( scores.getCount() == currentBufferSize ) {
Extension.context.onLeaderboardLoaded(scores);
}
else {
currentBufferSize = scores.getCount();
Games.Leaderboards.loadMoreScores( Extension.context.getApiClient(), scores, 25, PageDirection.NEXT ).setResultCallback( this );
}
}
开发者ID:freshplanet,项目名称:ANE-Google-Play-Game-Services,代码行数:15,代码来源:ScoresLoadedListener.java
示例12: incrementScore
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
/**
* Increments current score to leaderboard
* @param pLeaderboard
* @param pScore
*/
public void incrementScore(final String pLeaderboard, final long pScore){
if(isSignedIn() == false)
return;
final String playerId = getGamesClient().getCurrentPlayer().getPlayerId();
//Toast.makeText(this, "increment " + playerId, Toast.LENGTH_LONG).show();
getGamesClient().loadPlayerCenteredScores(new OnLeaderboardScoresLoadedListener() {
@Override
public void onLeaderboardScoresLoaded(int arg0, LeaderboardBuffer arg1, LeaderboardScoreBuffer arg2) {
Iterator <LeaderboardScore> it =arg2.iterator();
//Toast.makeText(ActivityBaseGameLeaderboard.this, "on score loaded", Toast.LENGTH_LONG).show();
if(it.hasNext() == false){
//Toast.makeText(ActivityBaseGameLeaderboard.this, "first submit", Toast.LENGTH_LONG).show();
submitScore(pLeaderboard, pScore);
return;
}
while(it.hasNext()){
LeaderboardScore lbScore = it.next();
long score = lbScore.getRawScore();
//Toast.makeText(ActivityBaseGameLeaderboard.this, score + " " + lbScore.getScoreHolder().getPlayerId(), Toast.LENGTH_LONG).show();
if(lbScore.getScoreHolder().getPlayerId().equals(playerId)){
submitScore(pLeaderboard, pScore + score);
}
}
}
}, pLeaderboard, LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC, 1);
}
开发者ID:laurion,项目名称:wabbit-client,代码行数:32,代码来源:GameHelper.java
示例13: fetchLeaderboardEntriesSync
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
private boolean fetchLeaderboardEntriesSync(String leaderBoardId, int limit, boolean relatedToPlayer,
IFetchLeaderBoardEntriesResponseListener callback) {
if (!isSessionActive())
return false;
if (gpgsLeaderboardIdMapper != null)
leaderBoardId = gpgsLeaderboardIdMapper.mapToGsId(leaderBoardId);
Leaderboards.LoadScoresResult scoresResult =
(relatedToPlayer ?
Games.Leaderboards.loadTopScores(mGoogleApiClient, leaderBoardId,
LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC,
MathUtils.clamp(limit, 1, 25), forceRefresh).await()
:
Games.Leaderboards.loadPlayerCenteredScores(mGoogleApiClient, leaderBoardId,
LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC,
MathUtils.clamp(limit, 1, 25), forceRefresh).await());
if (!scoresResult.getStatus().isSuccess()) {
Gdx.app.log(GAMESERVICE_ID, "Failed to fetch leaderboard entries:" +
scoresResult.getStatus().getStatusMessage());
callback.onLeaderBoardResponse(null);
return false;
}
LeaderboardScoreBuffer scores = scoresResult.getScores();
Array<ILeaderBoardEntry> gpgsLbEs = new Array<ILeaderBoardEntry>(scores.getCount());
String playerDisplayName = getPlayerDisplayName();
for (LeaderboardScore score : scores) {
GpgsLeaderBoardEntry gpgsLbE = new GpgsLeaderBoardEntry();
gpgsLbE.userDisplayName = score.getScoreHolderDisplayName();
gpgsLbE.currentPlayer = gpgsLbE.userDisplayName.equalsIgnoreCase(playerDisplayName);
gpgsLbE.formattedValue = score.getDisplayScore();
gpgsLbE.scoreRank = score.getDisplayRank();
gpgsLbE.userId = score.getScoreHolder().getPlayerId();
gpgsLbE.sortValue = score.getRawScore();
gpgsLbE.scoreTag = score.getScoreTag();
gpgsLbEs.add(gpgsLbE);
}
scores.release();
callback.onLeaderBoardResponse(gpgsLbEs);
return true;
}
开发者ID:MrStahlfelge,项目名称:gdx-gamesvcs,代码行数:51,代码来源:GpgsClient.java
示例14: getScores
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public final LeaderboardScoreBuffer getScores()
{
return this.ui;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:fl.java
示例15: onLeaderboardLoaded
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public void onLeaderboardLoaded( LeaderboardScoreBuffer scores ) {
dispatchEvent( "ON_LEADERBOARD_LOADED", scoresToJsonString(scores) );
}
开发者ID:freshplanet,项目名称:ANE-Google-Play-Game-Services,代码行数:4,代码来源:ExtensionContext.java
示例16: onLeaderboardScoresLoaded
import com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer; //导入依赖的package包/类
public void onLeaderboardScoresLoaded(int statusCode,
LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores) {
boolean found = false;
if (statusCode == GamesClient.STATUS_OK && mGLView != null && mGLView.mRenderer != null) {
String mId = mGamesClient.getCurrentPlayerId();
Log.i(TAG, "onLeaderboardScoresLoaded: ");
for (int i = 0; i < scores.getCount(); ++i) {
LeaderboardScore score = scores.get(i);
LeaderboardScore fScore = score.freeze();
if (fScore.getScoreHolder().getPlayerId().equals(mId)) {
found = true;
Log.i(TAG, "Found me at position " + i);
mGLView.mRenderer.setMyStats(fScore.getDisplayRank(), fScore.getDisplayScore(), (int)fScore.getRawScore());
if (i > 0) {
Log.i(TAG, "Found prev ");
LeaderboardScore prevScore = scores.get(i-1).freeze();
mGLView.mRenderer.setPrevPlayer(prevScore.getDisplayRank(), prevScore.getDisplayScore());
}
else {
mGLView.mRenderer.setPrevPlayer("", "");
}
if (i < scores.getCount()-1) {
Log.i(TAG, "Found next ");
LeaderboardScore nextScore = scores.get(i+1).freeze();
mGLView.mRenderer.setNextPlayer(nextScore.getDisplayRank(), nextScore.getDisplayScore());
}
else {
mGLView.mRenderer.setNextPlayer("", "");
}
break;
}
}
if (!found) {
mGLView.mRenderer.setMyStats("", "", -1);
}
}
else {
Toast.makeText(this, "Error retrieving scores " + statusCode, Toast.LENGTH_SHORT).show();
}
leaderboard.close();
scores.close();
}
开发者ID:d3alek,项目名称:TheHunt---Interactive-graphical-platform-for-AI-Experiments,代码行数:44,代码来源:TheHunt.java
注:本文中的com.google.android.gms.games.leaderboard.LeaderboardScoreBuffer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论