public class Player
Keeps information about a player:
basic info: name and color
state info: if they can time out, whether their game is paused
game result info: left & timeouts, to determine the winner and potential violation information
listeners: subscribers that get notified about new messages concerning this player, notably Welcome and Errors
Note: the toString/equals/hashCode/clone methods only take color and displayName into account!
@JvmOverloads
public Player(@NotNull
ITeam color,
@NotNull
java.lang.String displayName)
Keeps information about a player:
basic info: name and color
state info: if they can time out, whether their game is paused
game result info: left & timeouts, to determine the winner and potential violation information
listeners: subscribers that get notified about new messages concerning this player, notably Welcome and Errors
Note: the toString/equals/hashCode/clone methods only take color and displayName into account!
@JvmOverloads
public Player(@NotNull
ITeam color)
Keeps information about a player:
basic info: name and color
state info: if they can time out, whether their game is paused
game result info: left & timeouts, to determine the winner and potential violation information
listeners: subscribers that get notified about new messages concerning this player, notably Welcome and Errors
Note: the toString/equals/hashCode/clone methods only take color and displayName into account!
@NotNull protected java.util.List<sc.api.plugins.host.IPlayerListener> getListeners()
protected void setListeners(@NotNull
java.util.List<sc.api.plugins.host.IPlayerListener> p)
public boolean getCanTimeout()
public void setCanTimeout(boolean p)
public boolean getLeft()
public void setLeft(boolean p)
public boolean hasLeft()
public boolean getSoftTimeout()
public void setSoftTimeout(boolean p)
public boolean hasSoftTimeout()
public boolean getHardTimeout()
public void setHardTimeout(boolean p)
public boolean hasHardTimeout()
public boolean hasViolated()
@Nullable public java.lang.String getViolationReason()
public void setViolationReason(@Nullable
java.lang.String p)
public void addPlayerListener(@NotNull
IPlayerListener listener)
public void removePlayerListener(@NotNull
IPlayerListener listener)
public void notifyListeners(@NotNull
ProtocolMessage o)
public void requestMove()
@NotNull public java.lang.String toString()
@NotNull public Player clone()
public boolean equals(@Nullable
java.lang.Object other)
public int hashCode()
@NotNull public ITeam getColor()
public void setColor(@NotNull
ITeam p)
@NotNull public java.lang.String getDisplayName()
public void setDisplayName(@NotNull
java.lang.String p)