Player.MergeOption, Player.PlayerStats
Modifier and Type | Field and Description |
---|---|
private java.awt.geom.Point2D |
clickPoint
The point clicked to claim the next object to claim.
|
private GamePanel |
game
The panel visualising the game this player is playing in.
|
private ConvexObject |
nextClaim
The objected selected by the player as the next object to claim.
|
Constructor and Description |
---|
HumanPlayer(java.lang.String name)
Constructs a new human player with the given name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
executeMove()
Executes a move for this player.
|
void |
handleClaim(ConvexObject claimed,
java.awt.geom.Point2D location)
Handles a new object to try to claim for this player.
|
boolean |
requireInput()
Checks if this player currently requires input via the UI.
|
void |
setGamePanel(GamePanel game)
Sets the game panel visualising the game this player is playing in.
|
addArea, equals, findBestMergeFrom, findLargestUnownedObject, findLargestUnownedObject, getArea, getID, getName, getProxy, getScoreAnimation, getStats, getTheme, hashCode, hasMergeFrom, init, isAI, isLocal, owns, removeArea, setID, setName, stream, toString
private GamePanel game
private volatile ConvexObject nextClaim
clickPoint
private volatile java.awt.geom.Point2D clickPoint
nextClaim
public HumanPlayer(java.lang.String name)
name
- The name of the player.public void setGamePanel(GamePanel game)
game
- The game panel for this player.public boolean requireInput()
public void handleClaim(ConvexObject claimed, java.awt.geom.Point2D location)
claimed
- The object that was attempted to be claimed.location
- The point clicked to claim the given object.public boolean executeMove() throws java.lang.InterruptedException
Player
executeMove
in class Player
java.lang.InterruptedException
- When the player was
interrupted while making its move. Signalling
that the game was aborted.