제 논리가 처음으로 게임을 만들고 돌아서는 순간입니다. 두 번째 플레이어는 자신의 턴을 끝내고 finish()로 경기를 마칩니다.턴 기반 멀티 플레이 게임이 끝나지 않았습니다.
Games.TurnBasedMultiplayer.finishMatch(getApiClient(), mMatch.getMatchId(),
mTurnData.persist(), creatorResult, opponentResult)
.setResultCallback(new ResultCallback<TurnBasedMultiplayer.UpdateMatchResult>() {
@Override
public void onResult(TurnBasedMultiplayer.UpdateMatchResult result) {
processResult(result);
}
});
첫 번째 사용자는 Play 게임의 기본 제공받은 편지함에서 현재 자신의 차례임을 알게됩니다.
match.getStatus() == MATCH_STATUS_COMPLETE
하지만 match.getTurnStatus은() 내가 진정으로 게임을 종료하려면 어떻게
을 MATCH_TURN_STATUS_COMPLETE되지 않는 이유는 무엇입니까? 첫 번째 사용자는 플레이어 2가 게임을 마친 후 승자를보아야합니다.
샘플 코드에서는 모든 플레이어에 대해 마무리를 호출해야한다고 가정합니다. 이게 유일한 방법입니까? 플레이어는 게임과 함께 자신의 차례라는 통보를받습니다. 그것은 자극적이다.
// Note that in this state, you must still call "Finish" yourself,
// so we allow this to continue.
showWarning("Complete!",
"This game is over; someone finished it! You can only finish it now.");
감사