public interface

GameManagerState

com.google.android.gms.cast.games.GameManagerState

Class Overview

Represents a snapshot of the Game Manager's state.

Summary

Public Methods
abstract CharSequence getApplicationName()
Returns the application name.
abstract List<PlayerInfo> getConnectedControllablePlayers()
Returns the list of all players that are in a connected state and were created by this sender device.
abstract List<PlayerInfo> getConnectedPlayers()
Returns the list of all players that are in a connected state.
abstract List<PlayerInfo> getControllablePlayers()
Returns the list of all the players created by this sender device.
abstract JSONObject getGameData()
Returns the game-specific data.
abstract CharSequence getGameStatusText()
Returns the game status text.
abstract int getGameplayState()
Returns the state of the game.
abstract Collection<String> getListOfChangedPlayers(GameManagerState other)
Returns a list of player IDs that are different between this object and the provided GameManagerState.
abstract int getLobbyState()
Returns the current state of the lobby.
abstract int getMaxPlayers()
Returns the maximum number of players allowed by the game.
abstract PlayerInfo getPlayer(String playerId)
Returns the PlayerInfo for the specified playerId or null if the player does not exist.
abstract Collection<PlayerInfo> getPlayers()
Returns an unmodifiable collection of all the players in the game.
abstract List<PlayerInfo> getPlayersInState(int playerState)
Returns a list of all players that are in the specified player state.
abstract boolean hasGameDataChanged(GameManagerState other)
Returns whether the game data is different between this object and the provided GameManagerState.
abstract boolean hasGameStatusTextChanged(GameManagerState other)
Returns whether the game status text is different between this object and the provided GameManagerState.
abstract boolean hasGameplayStateChanged(GameManagerState other)
Returns whether the gameplay state is different between this object and the provided GameManagerState.
abstract boolean hasLobbyStateChanged(GameManagerState other)
Returns whether the lobby state is different between this object and the provided GameManagerState.
abstract boolean hasPlayerChanged(String playerId, GameManagerState other)
Returns whether the player with the provided player ID has changed between this object and the provided GameManagerState.
abstract boolean hasPlayerDataChanged(String playerId, GameManagerState other)
Returns whether the player data of the player with the specified player ID has changed between this object and the provided GameManagerState.
abstract boolean hasPlayerStateChanged(String playerId, GameManagerState other)
Returns whether the player state of the player with the specified player ID has changed between this object and the provided GameManagerState.

Public Methods

public abstract CharSequence getApplicationName ()

Returns the application name.

Returns
CharSequence

public abstract List<PlayerInfo> getConnectedControllablePlayers ()

Returns the list of all players that are in a connected state and were created by this sender device. A player is considered to be in a connected state if the associated getPlayerState() returns PLAYER_STATE_IDLE, PLAYER_STATE_AVAILABLE, PLAYER_STATE_PLAYING or PLAYER_STATE_READY.

Returns
List<PlayerInfo>

public abstract List<PlayerInfo> getConnectedPlayers ()

Returns the list of all players that are in a connected state. A player is considered to be in a connected state if the associated getPlayerState() returns PLAYER_STATE_IDLE, PLAYER_STATE_AVAILABLE, PLAYER_STATE_PLAYING or PLAYER_STATE_READY.

Returns
List<PlayerInfo>

See also:

public abstract List<PlayerInfo> getControllablePlayers ()

Returns the list of all the players created by this sender device.

Returns
List<PlayerInfo>

See also:

public abstract JSONObject getGameData ()

Returns the game-specific data. May return null.

Returns
JSONObject

public abstract CharSequence getGameStatusText ()

Returns the game status text.

Returns
CharSequence

public abstract int getGameplayState ()

Returns the state of the game. Gameplay states are defined in GameManagerClient and start with GAMEPLAY_STATE.

Returns
int

public abstract Collection<String> getListOfChangedPlayers (GameManagerState other)

Returns a list of player IDs that are different between this object and the provided GameManagerState. This includes players that were added, removed, or have changed in any way.

Parameters
other GameManagerState
Returns
Collection<String>

public abstract int getLobbyState ()

Returns the current state of the lobby. Lobby states are defined in GameManagerClient and start with LOBBY_STATE.

Returns
int

public abstract int getMaxPlayers ()

Returns the maximum number of players allowed by the game.

Returns
int

public abstract PlayerInfo getPlayer (String playerId)

Returns the PlayerInfo for the specified playerId or null if the player does not exist.

Parameters
playerId String: The id of the player.
Returns
PlayerInfo

public abstract Collection<PlayerInfo> getPlayers ()

Returns an unmodifiable collection of all the players in the game.

Returns
Collection<PlayerInfo>

public abstract List<PlayerInfo> getPlayersInState (int playerState)

Returns a list of all players that are in the specified player state. Player states are defined in GameManagerClient and start with PLAYER_STATE.

Parameters
playerState int: The player state to look for.
Returns
List<PlayerInfo>

public abstract boolean hasGameDataChanged (GameManagerState other)

Returns whether the game data is different between this object and the provided GameManagerState.

Parameters
other GameManagerState
Returns
boolean

public abstract boolean hasGameStatusTextChanged (GameManagerState other)

Returns whether the game status text is different between this object and the provided GameManagerState.

Parameters
other GameManagerState
Returns
boolean

public abstract boolean hasGameplayStateChanged (GameManagerState other)

Returns whether the gameplay state is different between this object and the provided GameManagerState.

Parameters
other GameManagerState
Returns
boolean

public abstract boolean hasLobbyStateChanged (GameManagerState other)

Returns whether the lobby state is different between this object and the provided GameManagerState.

Parameters
other GameManagerState
Returns
boolean

public abstract boolean hasPlayerChanged (String playerId, GameManagerState other)

Returns whether the player with the provided player ID has changed between this object and the provided GameManagerState.

Parameters
playerId String
other GameManagerState
Returns
boolean

public abstract boolean hasPlayerDataChanged (String playerId, GameManagerState other)

Returns whether the player data of the player with the specified player ID has changed between this object and the provided GameManagerState.

Parameters
playerId String
other GameManagerState
Returns
boolean

public abstract boolean hasPlayerStateChanged (String playerId, GameManagerState other)

Returns whether the player state of the player with the specified player ID has changed between this object and the provided GameManagerState.

Parameters
playerId String
other GameManagerState
Returns
boolean