Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
davi-bart committed Feb 16, 2024
2 parents 11b5f9c + eec0b9a commit 904c3eb
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 125 deletions.
105 changes: 53 additions & 52 deletions src/main/java/it/unibo/controller/main/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@
* Main controller.
*/
public interface MainController {
/**
* @return the board controller
*/
BoardController getBoardController();

/**
* @return the resource controller
*/
ResourceController getResourceController();

/**
* @return the list of the players' names
* Build a city in the given position.
*
* @param position where to build the city.
*/
List<String> getPlayerNames();
void buildCity(PropertyPosition position);

/**
* Build a settlement in the given position.
Expand All @@ -38,13 +31,6 @@ public interface MainController {
*/
void buildSettlement(PropertyPosition position);

/**
* Build a city in the given position.
*
* @param position where to build the city.
*/
void buildCity(PropertyPosition position);

/**
* Build a road in the given position.
*
Expand All @@ -57,18 +43,18 @@ public interface MainController {
*/
void buyCard();

/**
* @return whether the current player can build a settlement
* @param position where to build the settlement
*/
boolean canBuildSettlement(PropertyPosition position);

/**
* @return whether the current player can build a city
* @param position where to build the city
*/
boolean canBuildCity(PropertyPosition position);

/**
* @return whether the current player can build a settlement
* @param position where to build the settlement
*/
boolean canBuildSettlement(PropertyPosition position);

/**
* @return whether the current player can build a road
* @param position where to build the rode
Expand All @@ -81,27 +67,29 @@ public interface MainController {
boolean canBuyCard();

/**
* @return get the name of the player currently playing.
* @return whether the current player can end the turn
*/
String getCurrentPlayerName();
boolean canEndTurn();

/**
* get the points of the specified player.
* Set the robber in the specified position, removing it from the previous
* location.
*
* @param player the player
* @return the points of the player
* @param coordinates coordinates of the new robber's position
*/
int getPlayerPoints(String player);
void setRobberPosition(TilePosition coordinates);

/**
* @return whether the current player can end the turn
*
* @return true if the player must place the robber.
*/
boolean canEndTurn();
boolean mustPlaceRobber();

/**
* @return whether the current player can start a trade.
*
* @return the dice roll.
*/
boolean canStartTrade();
Pair<Integer, Integer> rollDie();

/**
*
Expand All @@ -123,39 +111,52 @@ void tradeWithPlayer(String proposer, String accepter, Map<ResourceType, Integer
Map<ResourceType, Integer> wantedResources);

/**
* Set the robber in the specified position, removing it from the previous
* location.
* Modify the resources of the owners into the trade (player and bank).
*
* @param coordinates coordinates of the new robber's position
* @param proposer is the player that propose the trade
* @param proposedResources are the resources that the proposer give to the
* bank
* @param wantedResources are the resources that the bank give to the
* proposer
*/
void setRobberPosition(TilePosition coordinates);
void tradeWithBank(String proposer, Map<ResourceType, Integer> proposedResources,
Map<ResourceType, Integer> wantedResources);

/**
*
* @return true if the player must place the robber.
* @return whether the current player can start a trade.
*/
boolean mustPlaceRobber();
boolean canStartTrade();

/**
* end the current turn and updates the current player.
*/
void endTurn();

/**
*
* @return the dice roll.
* @return the board controller
*/
Pair<Integer, Integer> rollDie();
BoardController getBoardController();

/**
* Modify the resources of the owners into the trade (player and bank).
* @return the resource controller
*/
ResourceController getResourceController();

/**
* @return the list of the players' names
*/
List<String> getPlayerNames();

/**
* @return get the name of the player currently playing.
*/
String getCurrentPlayerName();

/**
* get the points of the specified player.
*
* @param proposer is the player that propose the trade
* @param proposedResources are the resources that the proposer give to the
* bank
* @param wantedResources are the resources that the bank give to the
* proposer
* @param player the player
* @return the points of the player
*/
void tradeWithBank(String proposer, Map<ResourceType, Integer> proposedResources,
Map<ResourceType, Integer> wantedResources);
int getPlayerPoints(String player);
}
Loading

0 comments on commit 904c3eb

Please sign in to comment.