com.google.android.gms.games.multiplayer.turnbased.TurnBasedMatch |
![]()
|
Data interface for turn-based specific match functionality.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MATCH_STATUS_ACTIVE |
Constant returned by getStatus() indicating that the match has started.
|
|||||||||
int | MATCH_STATUS_AUTO_MATCHING |
Constant returned by getStatus() indicating that one or more slots are waiting to be
filled by auto-matching.
|
|||||||||
int | MATCH_STATUS_CANCELED |
Constant returned by getStatus() indicating that the match was canceled by one of
the participants.
|
|||||||||
int | MATCH_STATUS_COMPLETE |
Constant returned by getStatus() indicating that the match has finished.
|
|||||||||
int | MATCH_STATUS_EXPIRED |
Constant returned by getStatus() indicating that the match expired.
|
|||||||||
int | MATCH_TURN_STATUS_COMPLETE | Turn status constant for matches which have been completed. | |||||||||
int | MATCH_TURN_STATUS_INVITED | Turn status constant for matches which the current player has been invited to. | |||||||||
int | MATCH_TURN_STATUS_MY_TURN | Turn status constant for matches where it is the current player's turn. | |||||||||
int | MATCH_TURN_STATUS_THEIR_TURN | Turn status constant for matches where it is not the current player's turn. | |||||||||
int | MATCH_VARIANT_DEFAULT | Constant used to indicate that the variant for a match is unspecified. |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MATCH_TURN_STATUS_ALL | Array of all the turn status constants. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return whether or not this match can be rematched.
| |||||||||||
Retrieves the automatch criteria used to create or join this match, if any.
| |||||||||||
Return the maximum number of available automatch slots for this match.
| |||||||||||
Return the current (game-specific) data for this match.
| |||||||||||
Loads the match description into the given
CharArrayBuffer .
| |||||||||||
Get the participant representing the primary opponent in the match.
| |||||||||||
Get the ID of another participant in the match that can be used when describing the
participants the user is playing with.
| |||||||||||
Return the timestamp at which the match was last modified.
| |||||||||||
Return the ID of the participant who updated the match most recently.
| |||||||||||
Return the match sequence number for this match.
| |||||||||||
Get a participant in a match by its ID.
| |||||||||||
Get the participant ID for a given player.
| |||||||||||
Get the IDs of the participants of the given match.
| |||||||||||
Get the status of a participant in a match.
| |||||||||||
Return the ID of the participant that is considered pending.
| |||||||||||
Return the match data from the previous match, if available.
| |||||||||||
Return the match ID of the rematch that was created from this match, if any.
| |||||||||||
Return the current version of the match.
| |||||||||||
Return whether or not this match has been locally modified.
|
[Expand]
Inherited Methods | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||
![]()
| |||||||||||||||
![]()
|
Constant returned by getStatus()
indicating that the match has started.
Constant returned by getStatus()
indicating that one or more slots are waiting to be
filled by auto-matching.
Constant returned by getStatus()
indicating that the match was canceled by one of
the participants.
Constant returned by getStatus()
indicating that the match has finished.
Constant returned by getStatus()
indicating that the match expired.
Turn status constant for matches which have been completed.
Turn status constant for matches which the current player has been invited to.
Turn status constant for matches where it is the current player's turn.
Turn status constant for matches where it is not the current player's turn.
Constant used to indicate that the variant for a match is unspecified.
Array of all the turn status constants.
Return whether or not this match can be rematched. This will return true when the match has complete and has not already been rematched.
Retrieves the automatch criteria used to create or join this match, if any. May be null if the match has no automatch properties.
Return the maximum number of available automatch slots for this match. If automatch criteria were not specified during match creation, or if all slots have been filled, this will return 0.
Return the current (game-specific) data for this match.
Loads the match description into the given CharArrayBuffer
.
dataOut | The buffer to load the data into. |
---|
Get the participant representing the primary opponent in the match.
Note that this will return null
if there is no primary opponent. This could happen if
an automatch slot has not been filled.
Get the ID of another participant in the match that can be used when describing the participants the user is playing with. For example, in a four player match this might be used to state "Martha (and 2 others)".
Note that this will return null
if there is no primary opponent. This could happen if
an automatch slot has not been filled.
Game
object that owns this Match. Note that this should not be cached
separately from the Match itself, since the data underlying this object may change.
Return the timestamp at which the match was last modified.
Return the ID of the participant who updated the match most recently.
Return the match sequence number for this match. This number starts at 1, and increases every time a rematch is created.
Get a participant in a match by its ID. Note that the participant ID must correspond to a participant in this match, or this method will throw an exception.
participantId | Match-local ID of the participant to retrieve status for. |
---|
IllegalStateException} if the participant is not a participant in this match. |
Get the participant ID for a given player. This will only return a non-null ID if the player is actually a participant in the match and that player's identity is visible to the current player. Note that this will always return non-null for the current player.
To find the player ID for the current player, use getCurrentPlayerId(GoogleApiClient)
.
playerId | Player ID to find participant ID for. |
---|
Get the IDs of the participants of the given match.
Get the status of a participant in a match. Note that the participant ID must correspond to a participant in this match, or this method will throw an exception.
participantId | Match-local ID of the participant to retrieve status for. |
---|
STATUS_INVITED
, STATUS_JOINED
,
STATUS_DECLINED
, STATUS_LEFT
,
or STATUS_NOT_INVITED_YET
.IllegalStateException} if the participant is not a participant in this match. |
Return the ID of the participant that is considered pending. If no participant is considered pending (ie, the match is over, etc), this function will return null.
Return the match data from the previous match, if available. Note that this is only provided on the first turn of a rematched match.
Return the match ID of the rematch that was created from this match, if any. This will only be non-null if a rematch has been created.
MATCH_STATUS_AUTO_MATCHING
,
MATCH_STATUS_ACTIVE
, MATCH_STATUS_COMPLETE
,
MATCH_STATUS_EXPIRED
, or MATCH_STATUS_CANCELED
.
MATCH_TURN_STATUS_INVITED
, MATCH_TURN_STATUS_MY_TURN
,
MATCH_TURN_STATUS_THEIR_TURN
, or MATCH_TURN_STATUS_COMPLETE
.
MATCH_VARIANT_DEFAULT
.
Return the current version of the match.
Return whether or not this match has been locally modified. If this is true, the local device
has match state which has not successfully synced to the server yet. In this state, further
mutations to the match will fail with a status of
STATUS_MATCH_ERROR_LOCALLY_MODIFIED
.