Fix: ClientContrioller JavaDOC more fluid
This commit is contained in:
@@ -24,8 +24,9 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor of the class. Initializes all attributes.
|
* Constructs the ClientController.
|
||||||
* @param view The client view to set (either TUI or GUI).
|
* Initializes all attributes.
|
||||||
|
* @param view the client view (either TUI or GUI)
|
||||||
*/
|
*/
|
||||||
public ClientController(IView view) {
|
public ClientController(IView view) {
|
||||||
this.view = view;
|
this.view = view;
|
||||||
@@ -35,8 +36,8 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to set the network client.
|
* Sets the network client.
|
||||||
* @param client The client to sei (either TCP or RMI)
|
* @param client the client to set (either TCP or RMI)
|
||||||
*/
|
*/
|
||||||
public void setClient(IClient client) {
|
public void setClient(IClient client) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
@@ -44,8 +45,8 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to set the model in the Game Controller and in the view.
|
* Sets the model in the GameController and updates the view.
|
||||||
* @param model The model to set
|
* @param model the model to set
|
||||||
*/
|
*/
|
||||||
public void setModel(Game model) {
|
public void setModel(Game model) {
|
||||||
localController.setModel(model);
|
localController.setModel(model);
|
||||||
@@ -54,8 +55,8 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to show an error in the view.
|
* Displays an error message in the view.
|
||||||
* @param message The error message to show in the view
|
* @param message the error message to display
|
||||||
*/
|
*/
|
||||||
public void onError(String message) {
|
public void onError(String message) {
|
||||||
view.showError(message);
|
view.showError(message);
|
||||||
@@ -63,10 +64,10 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to draw a tribe card from the upper list.
|
* Requests to draw a tribe card from the upper list.
|
||||||
* Create a NetworkEvent and then sends it through the network client.
|
* Creates a NetworkEvent and sends it through the network client.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void drawUpperTribeCard(String playerUsername, int pos) {
|
public void drawUpperTribeCard(String playerUsername, int pos) {
|
||||||
client.doEvent(new DrawUpperTribeCard(playerUsername,pos));
|
client.doEvent(new DrawUpperTribeCard(playerUsername,pos));
|
||||||
@@ -74,30 +75,32 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to draw a tribe card from the lower list.
|
* Requests to draw a tribe card from the lower list.
|
||||||
* Create a NetworkEvent and then sends it through the network client.
|
* Creates a NetworkEvent and sends it through the network client.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void drawLowerTribeCard(String playerUsername,int pos) {
|
public void drawLowerTribeCard(String playerUsername,int pos) {
|
||||||
client.doEvent(new DrawLowerTribeCard(playerUsername,pos));
|
client.doEvent(new DrawLowerTribeCard(playerUsername,pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to draw a building card from the upper list.
|
* Requests to draw a building card from the upper list.
|
||||||
* Create a NetworkEvent and then sends it through the network client.
|
* Creates a NetworkEvent and sends it through the network client.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void drawUpperBuildingCard(String playerUsername,int pos) {
|
public void drawUpperBuildingCard(String playerUsername,int pos) {
|
||||||
client.doEvent(new DrawUpperBuildingCard(playerUsername,pos));
|
client.doEvent(new DrawUpperBuildingCard(playerUsername,pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to draw a building card from the lower list.
|
* Requests to draw a building card from the lower list.
|
||||||
* Create a NetworkEvent and then sends it through the network client.
|
* Creates a NetworkEvent and sends it through the network client.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void drawLowerBuildingCard(String playerUsername,int pos) {
|
public void drawLowerBuildingCard(String playerUsername,int pos) {
|
||||||
client.doEvent(new DrawLowerBuildingCard(playerUsername,pos));
|
client.doEvent(new DrawLowerBuildingCard(playerUsername,pos));
|
||||||
@@ -105,9 +108,9 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to skip the drawing action from the upper list.
|
* Requests to skip drawing from the upper list.
|
||||||
* Available only when the upper list is empty (or the player can't draw any card).
|
* This action is available only when the upper list is empty or the player cannot draw any card.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
*/
|
*/
|
||||||
public void skipUpper(String playerUsername) {
|
public void skipUpper(String playerUsername) {
|
||||||
client.doEvent(new SkipUpper(playerUsername));
|
client.doEvent(new SkipUpper(playerUsername));
|
||||||
@@ -115,9 +118,9 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to skip the drawing action from the lower list.
|
* Requests to skip drawing from the lower list.
|
||||||
* Available only when the lower list is empty (or the player can't draw any card).
|
* This action is available only when the lower list is empty or the player cannot draw any card.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
*/
|
*/
|
||||||
public void skipLower(String playerUsername) { client.doEvent(new SkipLower(playerUsername));}
|
public void skipLower(String playerUsername) { client.doEvent(new SkipLower(playerUsername));}
|
||||||
|
|
||||||
@@ -125,8 +128,8 @@ public class ClientController {
|
|||||||
/**
|
/**
|
||||||
* Used to draw a tribe card from the upper list.
|
* Used to draw a tribe card from the upper list.
|
||||||
* Available only if the player owns the building 12.
|
* Available only if the player owns the building 12.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void pickOptionalTribeCard(String playerUsername,int pos) {
|
public void pickOptionalTribeCard(String playerUsername,int pos) {
|
||||||
client.doEvent(new PickOptionalTribeCard(playerUsername,pos));
|
client.doEvent(new PickOptionalTribeCard(playerUsername,pos));
|
||||||
@@ -136,17 +139,18 @@ public class ClientController {
|
|||||||
/**
|
/**
|
||||||
* Used to draw a building card from the upper list.
|
* Used to draw a building card from the upper list.
|
||||||
* Available only if the player owns the building 12.
|
* Available only if the player owns the building 12.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the card to draw
|
* @param pos the index of the card to draw
|
||||||
*/
|
*/
|
||||||
public void pickOptionalBuildingCard(String playerUsername,int pos) {
|
public void pickOptionalBuildingCard(String playerUsername,int pos) {
|
||||||
client.doEvent(new PickOptionalBuildingCard(playerUsername,pos));
|
client.doEvent(new PickOptionalBuildingCard(playerUsername,pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to skip the action of drawing a card from the upper list.
|
* Used to skip the action of drawing a card from the upper list.
|
||||||
* Available only if the player owns the building 12.
|
* Available only if the player owns the building 12.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
*/
|
*/
|
||||||
public void noOptionalCard(String playerUsername) {
|
public void noOptionalCard(String playerUsername) {
|
||||||
client.doEvent(new NoOptionalCard(playerUsername));
|
client.doEvent(new NoOptionalCard(playerUsername));
|
||||||
@@ -154,9 +158,9 @@ public class ClientController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to sperform the slot choiche action for the specified player at the specified position.
|
* Used to perform the slot choice action for the specified player at the specified position.
|
||||||
* @param playerUsername The name of the player who requested to perform the action
|
* @param playerUsername the name of the player performing the action
|
||||||
* @param pos Index of the selected slot
|
* @param pos the index of the selected slot
|
||||||
*/
|
*/
|
||||||
public void slotChoice(String playerUsername,int pos) {
|
public void slotChoice(String playerUsername,int pos) {
|
||||||
client.doEvent(new SlotChoice(playerUsername,pos));
|
client.doEvent(new SlotChoice(playerUsername,pos));
|
||||||
|
|||||||
Reference in New Issue
Block a user