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 int
getAvtarId()
The avatar Id of the playerJsonObject
getData()
Returns the player's data as jsonString
getName()
The name of the playerString
getProfilePic()
Returns the url of player's profile pictureint
getTurnTimeLeftMillis()
Returns the turn time left in millisecondsboolean
isActive()
Returns true if the player is an active player (taking part in the current game play)boolean
isCurTurn()
Returns true if the current turn is the players turnboolean
isSameAsClient(Client client)
Returns true if the player belongs to the specified clientboolean
shouldUseProfilePicture()
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
-