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


Java TurnBasedMultiplayer.InitiateMatchResult方法代码示例

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


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

示例1: quickMatch

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
@Override
public void quickMatch() {
	Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(
			1, 1, 0);

	TurnBasedMatchConfig tbmc = TurnBasedMatchConfig.builder()
			.setAutoMatchCriteria(autoMatchCriteria).build();

	

	// Start the match
	ResultCallback<TurnBasedMultiplayer.InitiateMatchResult> cb = new ResultCallback<TurnBasedMultiplayer.InitiateMatchResult>() {
		@Override
		public void onResult(TurnBasedMultiplayer.InitiateMatchResult result) {
			processResult(result);
		}
	};
	Games.TurnBasedMultiplayer.createMatch(gameHelper.getApiClient(), tbmc).setResultCallback(cb);
}
 
开发者ID:antonioalmeida,项目名称:retro-reversi,代码行数:20,代码来源:AndroidLauncher.java

示例2: onQuickMatchClicked

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
public void onQuickMatchClicked(View view) {

        Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(
                1, 1, 0);

        TurnBasedMatchConfig tbmc = TurnBasedMatchConfig.builder()
                .setAutoMatchCriteria(autoMatchCriteria).build();

        showSpinner();

        // Start the match
        ResultCallback<TurnBasedMultiplayer.InitiateMatchResult> cb = new ResultCallback<TurnBasedMultiplayer.InitiateMatchResult>() {
            @Override
            public void onResult(TurnBasedMultiplayer.InitiateMatchResult result) {
                processResult(result);
            }
        };
        Games.TurnBasedMultiplayer.createMatch(mGoogleApiClient, tbmc).setResultCallback(cb);
    }
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:20,代码来源:SkeletonActivity.java

示例3: processResult

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
private void processResult(TurnBasedMultiplayer.InitiateMatchResult result) {
    TurnBasedMatch match = result.getMatch();
    dismissSpinner();

    if (!checkStatusCode(match, result.getStatus().getStatusCode())) {
        return;
    }

    if (match.getData() != null) {
        // This is a game that has already started, so I'll just start
        updateMatch(match);
        return;
    }

    startMatch(match);
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:17,代码来源:SkeletonActivity.java

示例4: processResult

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
private void processResult(TurnBasedMultiplayer.InitiateMatchResult result) {
	TurnBasedMatch match = result.getMatch();

	if (!checkStatusCode(match, result.getStatus().getStatusCode()))
		return;

	if (match.getData() != null) {
		// This is a game that has already started, so I'll just start
		updateMatch(match);
		return;
	}

	startMatch(match);
}
 
开发者ID:antonioalmeida,项目名称:retro-reversi,代码行数:15,代码来源:AndroidLauncher.java

示例5: onResult

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
@Override
public void onResult(TurnBasedMultiplayer.InitiateMatchResult result) {
    // Check if the status code is not success.
    Status status = result.getStatus();
    if (!status.isSuccess()) {
        Log.d("##MACHINITIATEDCALLBACK","errore!");
        return;
    }

    TurnBasedMatch match = result.getMatch();

    // If this player is not the first player in this match, continue.
    if (match.getData() != null) {
        Log.d("##MACHINITIATEDCALLBACK","WAITING FOR MY TURN");
        return;
    }

    // Otherwise, this is the first player. Initialize the game state.
    Log.d("##MACHINITIATEDCALLBACK","GAME STARTED");
    //initGame(match);



    // Let the player take the first turn
    Log.d("##MACHINITIATEDCALLBACK","showTurnUi");
    //showTurnUI(match);

}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:29,代码来源:MatchInitiatedCallback.java

示例6: acceptInvitation

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

示例7: createMatch

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
public final PendingResult<TurnBasedMultiplayer.InitiateMatchResult> createMatch(GoogleApiClient paramGoogleApiClient, final TurnBasedMatchConfig paramTurnBasedMatchConfig)
{
  return paramGoogleApiClient.b(new b(paramTurnBasedMatchConfig)
  {
    protected void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.a(this, paramTurnBasedMatchConfig);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:gb.java

示例8: rematch

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

示例9: D

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
public TurnBasedMultiplayer.InitiateMatchResult D(final Status paramStatus)
{
  return new TurnBasedMultiplayer.InitiateMatchResult()
  {
    public TurnBasedMatch getMatch()
    {
      return null;
    }

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

示例10: startNewGame

import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer; //导入方法依赖的package包/类
private void startNewGame(TurnBasedMultiplayer.InitiateMatchResult result) {
    TurnBasedMatch match = result.getMatch();

    int status = result.getStatus().getStatusCode();
    if (status != GamesStatusCodes.STATUS_OK && status != GamesStatusCodes.STATUS_NETWORK_ERROR_OPERATION_DEFERRED) {
        return;
    }

    // Initial setup
    if (match.getData() == null) {
        MultiplayerData initialData = initDataAndUI(match);
        takeTurn(match.getMatchId(), initialData.toBytes(), initialData.getPlayer2ID());
    }
}
 
开发者ID:dbaelz,项目名称:NotAlways42,代码行数:15,代码来源:MultiplayerFragment.java


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