你可以这样说:
String localPlayerId = Games.Players.getCurrentPlayerId(getApiClient());
Participant localParticipant = mMatch.getParticipant(mMatch.getParticipantId(localPlayerId));
ParticipantResult result = localParticipant.getResult();
if (result != null && result.getResult() == ParticipantResult.MATCH_RESULT_WIN) {
// Local player won, show greetings...
}
注意:对于工作,你必须在以前被称为finishMatch(..)与参与者的结果是这样的:
List<ParticipantResult> participantResults = new ArrayList<ParticipantResult>();
participantResults.add(new ParticipantResult(participantId1, ParticipantResult.MATCH_RESULT_WIN, 1));
participantResults.add(new ParticipantResult(participantId2, ParticipantResult.MATCH_RESULT_LOSS, 2));
Games.TurnBasedMultiplayer.finishMatch(
getApiClient(),
mMatch.getMatchId(),
gameData,
participantResults
);