Interface IClient
public interface IClient
Defines the operations that a client can request during the game.
-
Method Summary
Modifier and TypeMethodDescriptionConnects the client to the server using the specified username and preferred connection type.voiddrawLowerBuildingCard(String playerUsername, int pos) Requests to draw a building card from the lower building card list.voiddrawLowerTribeCard(String playerUsername, int pos) Requests to draw a tribe card from the lower tribe card list.voiddrawUpperBuildingCard(String playerUsername, int pos) Requests to draw a building card from the upper building card list.voiddrawUpperTribeCard(String playerUsername, int pos) Requests to draw a tribe card from the upper tribe card list.voidNotifies the server of a voluntary disconnection and closes the connection.voidRequests to skip the current player's optional action.voidslotChoice(String playerUsername, int pos) Requests to assign the specified player to a slot.voidtotemChoice(String playerUsername, String totem) Requests to assign the selected totem to the specified player.
-
Method Details
-
connect
Connects the client to the server using the specified username and preferred connection type.- Parameters:
username- the username chosen by the player.proposedNPlayers- the desired number of players proposed by this client.- Returns:
trueif the connection is established successfully,falseotherwise.
-
drawUpperTribeCard
Requests to draw a tribe card from the upper tribe card list.- Parameters:
playerUsername- the username of the player performing the action.pos- the position of the selected card in the upper tribe card list.
-
drawLowerTribeCard
Requests to draw a tribe card from the lower tribe card list.- Parameters:
playerUsername- the username of the player performing the action.pos- the position of the selected card in the lower tribe card list.
-
drawUpperBuildingCard
Requests to draw a building card from the upper building card list.- Parameters:
playerUsername- the username of the player performing the action.pos- the position of the selected card in the upper building card list.
-
drawLowerBuildingCard
Requests to draw a building card from the lower building card list.- Parameters:
playerUsername- the username of the player performing the action.pos- the position of the selected card in the lower building card list.
-
skipTurn
Requests to skip the current player's optional action.- Parameters:
playerUsername- the username of the player skipping the action.
-
slotChoice
Requests to assign the specified player to a slot.- Parameters:
playerUsername- the username of the player making the slot choice.pos- the position of the selected slot.
-
totemChoice
-
notifyDisconnection
void notifyDisconnection()Notifies the server of a voluntary disconnection and closes the connection.
-