当前位置: 首页>>代码示例>>Java>>正文


Java Achievements.UpdateAchievementResult方法代码示例

本文整理汇总了Java中com.google.android.gms.games.achievement.Achievements.UpdateAchievementResult方法的典型用法代码示例。如果您正苦于以下问题:Java Achievements.UpdateAchievementResult方法的具体用法?Java Achievements.UpdateAchievementResult怎么用?Java Achievements.UpdateAchievementResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.games.achievement.Achievements的用法示例。


在下文中一共展示了Achievements.UpdateAchievementResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "GameServices::unlockAchievement" );
	String achievementId = FREObjectUtils.getString( args[0] );
	boolean immediate = FREObjectUtils.getBoolean( args[1] );

	GameServicesHelper helper = GameServicesHelper.getInstance();
	if( helper.isAuthenticated() ) {
		if( immediate ) {
			PendingResult<Achievements.UpdateAchievementResult> result = Games.Achievements.unlockImmediate( helper.getClient(), achievementId );
			result.setResultCallback( this, 10, TimeUnit.SECONDS );
			return null;
		}

		Games.Achievements.unlock( helper.getClient(), achievementId );
		AIR.log( "Successfully unlocked achievement: " + achievementId );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
	} else {
		helper.dispatchAchievementUpdateError();
	}

	return null;
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:26,代码来源:UnlockAchievementFunction.java

示例2: call

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "GameServices::revealAchievement" );
	String achievementId = FREObjectUtils.getString( args[0] );
	boolean immediate = FREObjectUtils.getBoolean( args[1] );

	GameServicesHelper helper = GameServicesHelper.getInstance();
	if( helper.isAuthenticated() ) {
		if( immediate ) {
			PendingResult<Achievements.UpdateAchievementResult> result = Games.Achievements.revealImmediate( helper.getClient(), achievementId );
			result.setResultCallback( this, 10, TimeUnit.SECONDS );
			return null;
		}

		Games.Achievements.reveal( helper.getClient(), achievementId );
		AIR.log( "Successfully revealed achievement: " + achievementId );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
	} else {
		helper.dispatchAchievementUpdateError();
	}

	return null;
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:26,代码来源:RevealAchievementFunction.java

示例3: call

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "GameServices::setAchievementSteps" );
	String achievementId = FREObjectUtils.getString( args[0] );
	int numSteps = FREObjectUtils.getInt( args[1] );
	boolean immediate = FREObjectUtils.getBoolean( args[2] );

	GameServicesHelper helper = GameServicesHelper.getInstance();
	if( helper.isAuthenticated() ) {
		if( immediate ) {
			PendingResult<Achievements.UpdateAchievementResult> result = Games.Achievements.setStepsImmediate( helper.getClient(), achievementId, numSteps );
			result.setResultCallback( this, 10, TimeUnit.SECONDS );
			return null;
		}

		Games.Achievements.setSteps( helper.getClient(), achievementId, numSteps );
		AIR.log( "Successfully set steps for achievement: " + achievementId );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
	} else {
		helper.dispatchAchievementUpdateError();
	}

	return null;
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:27,代码来源:SetAchievementStepsFunction.java

示例4: call

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "GameServices::incrementAchievement" );
	String achievementId = FREObjectUtils.getString( args[0] );
	int numSteps = FREObjectUtils.getInt( args[1] );
	boolean immediate = FREObjectUtils.getBoolean( args[2] );

	GameServicesHelper helper = GameServicesHelper.getInstance();
	if( helper.isAuthenticated() ) {
		if( immediate ) {
			PendingResult<Achievements.UpdateAchievementResult> result = Games.Achievements.incrementImmediate( helper.getClient(), achievementId, numSteps );
			result.setResultCallback( this, 10, TimeUnit.SECONDS );
			return null;
		}

		Games.Achievements.increment( helper.getClient(), achievementId, numSteps );
		AIR.log( "Successfully incremented steps for achievement: " + achievementId );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
	} else {
		helper.dispatchAchievementUpdateError();
	}

	return null;
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:27,代码来源:IncrementAchievementFunction.java

示例5: onResult

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Achievements.UpdateAchievementResult result ) {
	com.google.android.gms.common.api.Status status = result.getStatus();

	if( !status.isSuccess() ) {
		AIR.log( "Failed to unlock achievement: " + status.getStatusMessage() );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_ERROR, status.getStatusMessage() );
		return;
	}

	AIR.log( "Successfully unlocked achievement" );
	AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:14,代码来源:UnlockAchievementFunction.java

示例6: onResult

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Achievements.UpdateAchievementResult result ) {
	com.google.android.gms.common.api.Status status = result.getStatus();

	if( !status.isSuccess() ) {
		AIR.log( "Failed to reveal achievement: " + status.getStatusMessage() );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_ERROR, status.getStatusMessage() );
		return;
	}

	AIR.log( "Successfully revealed achievement" );
	AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:14,代码来源:RevealAchievementFunction.java

示例7: onResult

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Achievements.UpdateAchievementResult result ) {
	com.google.android.gms.common.api.Status status = result.getStatus();

	if( !status.isSuccess() ) {
		AIR.log( "Failed to set achievement steps: " + status.getStatusMessage() );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_ERROR, status.getStatusMessage() );
		return;
	}

	AIR.log( "Successfully set achievement steps" );
	AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:14,代码来源:SetAchievementStepsFunction.java

示例8: onResult

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Achievements.UpdateAchievementResult result ) {
	com.google.android.gms.common.api.Status status = result.getStatus();

	if( !status.isSuccess() ) {
		AIR.log( "Failed to increment achievement: " + status.getStatusMessage() );
		AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_ERROR, status.getStatusMessage() );
		return;
	}

	AIR.log( "Successfully incremented achievement steps" );
	AIR.dispatchEvent( GameServicesEvent.ACHIEVEMENT_UPDATE_SUCCESS );
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:14,代码来源:IncrementAchievementFunction.java

示例9: incrementImmediate

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
public final PendingResult<Achievements.UpdateAchievementResult> incrementImmediate(GoogleApiClient paramGoogleApiClient, final String paramString, final int paramInt)
{
  return paramGoogleApiClient.b(new b(paramString)
  {
    public void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.a(this, paramString, paramInt);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fs.java

示例10: revealImmediate

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
public final PendingResult<Achievements.UpdateAchievementResult> revealImmediate(GoogleApiClient paramGoogleApiClient, final String paramString)
{
  return paramGoogleApiClient.b(new b(paramString)
  {
    public void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.b(this, paramString);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fs.java

示例11: setStepsImmediate

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
public final PendingResult<Achievements.UpdateAchievementResult> setStepsImmediate(GoogleApiClient paramGoogleApiClient, final String paramString, final int paramInt)
{
  return paramGoogleApiClient.b(new b(paramString)
  {
    public void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.b(this, paramString, paramInt);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fs.java

示例12: unlockImmediate

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
public final PendingResult<Achievements.UpdateAchievementResult> unlockImmediate(GoogleApiClient paramGoogleApiClient, final String paramString)
{
  return paramGoogleApiClient.b(new b(paramString)
  {
    public void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.c(this, paramString);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fs.java

示例13: u

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
public Achievements.UpdateAchievementResult u(final Status paramStatus)
{
  return new Achievements.UpdateAchievementResult()
  {
    public String getAchievementId()
    {
      return fs.b.a(fs.b.this);
    }

    public Status getStatus()
    {
      return paramStatus;
    }
  };
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:16,代码来源:fs.java

示例14: doAchievements

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
protected void doAchievements(double time, double recordTime) {
	int roundNumber = PreferenceManager.getDefaultSharedPreferences(this).getInt("rounds_finished", 0);
	roundNumber++;
	PreferenceManager.getDefaultSharedPreferences(this).edit().putInt("rounds_finished", roundNumber).apply();

	if (helper == null || !helper.isSignedIn()) {
		return; // nothing else to do
	}

	ResultCallback<Achievements.UpdateAchievementResult> callback = new ResultCallback<Achievements.UpdateAchievementResult>() {
		@Override
		public void onResult(UpdateAchievementResult arg0) {
			Log.d("scores", arg0.getAchievementId() + " " + arg0.getStatus().toString());
		}
	};

	boolean offline = (recordTime == 0);
	if (!offline) {
		if (time < recordTime || recordTime < 0) {
			Games.Achievements.unlockImmediate(helper.getApiClient(), getString(R.string.achievement_be_the_best)).setResultCallback(callback);
		}
	}
	if (roundNumber >= 1) {
		Games.Achievements.unlockImmediate(helper.getApiClient(), getString(R.string.achievement_first_round)).setResultCallback(callback);
	}
	if (roundNumber >= 10) {
		Games.Achievements.unlockImmediate(helper.getApiClient(), getString(R.string.achievement_go_10_rounds)).setResultCallback(callback);
	}
	if (roundNumber >= 25) {
		Games.Achievements.unlockImmediate(helper.getApiClient(), getString(R.string.achievement_go_25_rounds)).setResultCallback(callback);
	}
}
 
开发者ID:ellenpoe,项目名称:BlitzCalc,代码行数:33,代码来源:GameActivity.java

示例15: onResult

import com.google.android.gms.games.achievement.Achievements; //导入方法依赖的package包/类
@Override
public void onResult(@NonNull Achievements.UpdateAchievementResult updateAchievementResult) {
    Log.d("##AchievementCallback", updateAchievementResult.toString());
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:5,代码来源:AchievementCallback.java


注:本文中的com.google.android.gms.games.achievement.Achievements.UpdateAchievementResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。