Package io.sockit.gameclient
Class Player
java.lang.Object
io.sockit.gameclient.Player
public class Player extends Object
This class represents a Player seated in the room and can be used to render a player onto the UI
-
Field Summary
-
Method Summary
Modifier and Type Method Description intgetAvtarId()The avatar Id of the playerJsonObjectgetData()Returns the player's data as jsonStringgetName()The name of the playerStringgetProfilePic()Returns the url of player's profile pictureintgetTurnTimeLeftMillis()Returns the turn time left in millisecondsbooleanisActive()Returns true if the player is an active player (taking part in the current game play)booleanisCurTurn()Returns true if the current turn is the players turnbooleanisSameAsClient(Client client)Returns true if the player belongs to the specified clientbooleanshouldUseProfilePicture()Indicates whether to display the player's profile picture or the player's avatar
-
Field Details
-
Method Details
-
getName
The name of the player- Returns:
- String - the name of the player
-
getAvtarId
public int getAvtarId()The avatar Id of the player- Returns:
- int - the avatar Id of the player
-
shouldUseProfilePicture
public boolean shouldUseProfilePicture()Indicates whether to display the player's profile picture or the player's avatar- Returns:
- boolean - true if the player's profile picture should be displayed instead of the player's avatar
-
getProfilePic
Returns the url of player's profile picture- Returns:
- String - the url of player's profile picture
-
isActive
public boolean isActive()Returns true if the player is an active player (taking part in the current game play)- Returns:
- boolean - true if the player is an active player
-
getTurnTimeLeftMillis
public int getTurnTimeLeftMillis()Returns the turn time left in milliseconds- Returns:
- int - the turn time left in milliseconds
-
getData
Returns the player's data as json- Returns:
- JsonObject - the player's data as json
-
isCurTurn
public boolean isCurTurn()Returns true if the current turn is the players turn- Returns:
- boolean - true if the current turn is the players turn
-
isSameAsClient
Returns true if the player belongs to the specified client- Parameters:
client- - the client to check- Returns:
- boolean - true if the player belongs to the specified client
-