本文整理汇总了Java中com.google.android.gms.games.multiplayer.turnbased.TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN属性的典型用法代码示例。如果您正苦于以下问题:Java TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN属性的具体用法?Java TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN怎么用?Java TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.gms.games.multiplayer.turnbased.TurnBasedMatch
的用法示例。
在下文中一共展示了TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTurnBasedMatchReceived
@Override
public void onTurnBasedMatchReceived(TurnBasedMatch match) {
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
if (status != TurnBasedMatch.MATCH_STATUS_CANCELED &&
status != TurnBasedMatch.MATCH_STATUS_EXPIRED &&
status != TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING &&
status != TurnBasedMatch.MATCH_STATUS_COMPLETE) {
if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {
directUserToPlayGamesGUI("Received Match Update. It's your turn!");
} else if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN) {
Toast.makeText(this, "Next Player's turn. We'll notify you when it's your turn again.", Toast.LENGTH_LONG).show();
} else if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_INVITED) {
Toast.makeText(this, "Player invitations have been sent", Toast.LENGTH_LONG).show();
}
} else if (status == TurnBasedMatch.MATCH_STATUS_COMPLETE) {
directUserToPlayGamesGUI("You have a game that just finished. Click 'View' to see the results");
}
}
示例2: updateMatch
public void updateMatch(TurnBasedMatch match) {
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
switch (status) {
case TurnBasedMatch.MATCH_STATUS_CANCELED:
showWarning("Canceled!", "This game was canceled!");
return;
case TurnBasedMatch.MATCH_STATUS_EXPIRED:
showWarning("Expired!", "This game is expired. So sad!");
return;
case TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING:
showWarning("Waiting for auto-match...",
"We're still waiting for an automatch partner.");
return;
case TurnBasedMatch.MATCH_STATUS_COMPLETE:
directUserToPlayGamesGUI("This game is complete. Click 'View' to see results");
return;
}
// OK, it's active. Check on turn status.
switch (turnStatus) {
case TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN:
launchRound(match);
return;
case TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN:
// Should return results.
showWarning("Alas...", "It's not your turn.");
break;
case TurnBasedMatch.MATCH_TURN_STATUS_INVITED:
showWarning("Good inititative!",
"Still waiting for invitations.\n\nBe patient!");
}
}
示例3: updateMatch
public void updateMatch(TurnBasedMatch match) {
mMatch = match;
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
switch (status) {
case TurnBasedMatch.MATCH_STATUS_CANCELED:
showWarning("Canceled!", "This game was canceled!");
return;
case TurnBasedMatch.MATCH_STATUS_EXPIRED:
showWarning("Expired!", "This game is expired. So sad!");
return;
case TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING:
showWarning("Waiting for auto-match...",
"We're still waiting for an automatch partner.");
return;
case TurnBasedMatch.MATCH_STATUS_COMPLETE:
if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_COMPLETE) {
showWarning(
"Complete!",
"This game is over!");
break;
}
// Note that in this state, you must still call "Finish" yourself,
// so we allow this to continue.
showWarning("Complete!",
"This game is over! You can only finish it now.");
}
// OK, it's active. Check on turn status.
switch (turnStatus) {
case TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN:
mTurnData = GameModelWrapper.convertFromByteArray(mMatch.getData());
reversi.setOnlineMatchScreen();
return;
case TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN:
// Should return results.
showWarning("Alas...", "It's not your turn.");
break;
case TurnBasedMatch.MATCH_TURN_STATUS_INVITED:
showWarning("Good inititative!",
"Still waiting for invitations.\n\nBe patient!");
}
mTurnData = null;
}
示例4: updateMatch
public void updateMatch(TurnBasedMatch match) {
mMatch = match;
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
switch (status) {
case TurnBasedMatch.MATCH_STATUS_CANCELED:
showWarning("Canceled!", "This game was canceled!");
return;
case TurnBasedMatch.MATCH_STATUS_EXPIRED:
showWarning("Expired!", "This game is expired. So sad!");
return;
case TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING:
showWarning("Waiting for auto-match...",
"We're still waiting for an automatch partner.");
return;
case TurnBasedMatch.MATCH_STATUS_COMPLETE:
if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_COMPLETE) {
showWarning(
"Complete!",
"This game is over; someone finished it, and so did you! There is nothing to be done.");
break;
}
// 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.");
}
// OK, it's active. Check on turn status.
switch (turnStatus) {
case TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN:
mTurnData = SkeletonTurn.unpersist(mMatch.getData());
setGameplayUI();
return;
case TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN:
// Should return results.
showWarning("Alas...", "It's not your turn.");
break;
case TurnBasedMatch.MATCH_TURN_STATUS_INVITED:
showWarning("Good inititative!",
"Still waiting for invitations.\n\nBe patient!");
}
mTurnData = null;
setViewVisibility();
}
示例5: updateMatch
public void updateMatch(TurnBasedMatch match) {
mMatch = match;
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
switch (status) {
case TurnBasedMatch.MATCH_STATUS_CANCELED:
showWarning("Canceled!", "This game was canceled!");
return;
case TurnBasedMatch.MATCH_STATUS_EXPIRED:
showWarning("Expired!", "This game is expired. So sad!");
return;
case TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING:
showWarning("Waiting for auto-match...",
"We're still waiting for an automatch partner.");
return;
case TurnBasedMatch.MATCH_STATUS_COMPLETE:
if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_COMPLETE) {
showWarning(
"Complete!",
"This game is over; someone finished it, and so did you! There is nothing to be done.");
break;
}
// 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.");
}
// OK, it's active. Check on turn status.
switch (turnStatus) {
case TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN:
mTurnData = TurnData.unpersist(mMatch.getData());
setGameplayUI();
return;
case TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN:
// Should return results.
showWarning("Alas...", "It's not your turn.");
break;
case TurnBasedMatch.MATCH_TURN_STATUS_INVITED:
showWarning("Good inititative!",
"Still waiting for invitations.\n\nBe patient!");
}
mTurnData = null;
mContext.setViewVisibility();
}
示例6: updateMatch
public void updateMatch(TurnBasedMatch match) {
mMatch = match;
int status = match.getStatus();
int turnStatus = match.getTurnStatus();
switch (status) {
case TurnBasedMatch.MATCH_STATUS_CANCELED:
showWarning("Canceled!", "This game was canceled!");
return;
case TurnBasedMatch.MATCH_STATUS_EXPIRED:
showWarning("Expired!", "This game is expired. So sad!");
return;
case TurnBasedMatch.MATCH_STATUS_AUTO_MATCHING:
showWarning("Waiting for auto-match...",
"We're still waiting for an automatch partner.");
return;
case TurnBasedMatch.MATCH_STATUS_COMPLETE:
if (turnStatus == TurnBasedMatch.MATCH_TURN_STATUS_COMPLETE) {
showWarning("Complete!",
"This game is over; someone finished it, and so did you! " +
"There is nothing to be done.");
break;
}
// 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.");
}
// OK, it's active. Check on turn status.
switch (turnStatus) {
case TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN:
mTurnData = SkeletonTurn.unpersist(mMatch.getData());
setGameplayUI();
return;
case TurnBasedMatch.MATCH_TURN_STATUS_THEIR_TURN:
// Should return results.
showWarning("Alas...", "It's not your turn.");
break;
case TurnBasedMatch.MATCH_TURN_STATUS_INVITED:
showWarning("Good inititative!",
"Still waiting for invitations.\n\nBe patient!");
}
mTurnData = null;
setViewVisibility();
}