diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 455f028..a257030 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -1,7 +1,6 @@
The method lists all active, non-loopback and non-virtual network
+ * interfaces with an IPv4 address. If only one interface is available, it is
+ * selected automatically.
+ *
+ * @param scanner the scanner used to read the user's choice.
+ * @return the selected IPv4 address as a string.
+ * @throws Exception if no valid network interface is available.
+ */
public static String chooseNetworkInterface(Scanner scanner) throws Exception {
List The effect type is determined from the given effect identifier.
+ *
+ * @param idIMG the image identifier of the building card.
* @param effectId the identifier of the effect associated with the building card.
* @param era the era of the building card.
* @param price the price of the building card.
* @param prestigeValue the prestige value of the building card.
* @throws IllegalArgumentException if the effect identifier is not valid,
- * if {@code price <= 0}, or if {@code prestigeValue < 0}
+ * if {@code price <= 0}, or if {@code prestigeValue < 0}.
*/
public BuildingCard(String idIMG,int effectId ,int era,int price,int prestigeValue) throws IllegalArgumentException{
this.effectId = effectId;
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCard.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCard.java
index 0950f46..f7ec819 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCard.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCard.java
@@ -50,10 +50,12 @@ public abstract class TribeCard extends PlayableCard implements Serializable {
public TribeCard(int Era,boolean isEventCard) {
this(Era,isEventCard,0);
}
+
/**
- * Creates a tribe card with the specified era and event-card flag.
+ * Creates a tribe card with the specified image id, era and event-card flag.
* The minimum number of players is set to 0.
*
+ * @param idIMG the image identifier of the tribe card.
* @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card.
*/
@@ -76,9 +78,10 @@ public abstract class TribeCard extends PlayableCard implements Serializable {
}
/**
- * Creates a tribe card with the specified era, event-card flag,
+ * Creates a tribe card with the specified image id, era, event-card flag,
* and minimum number of players.
*
+ * @param idIMG the image identifier of the tribe card.
* @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card.
* @param nMin the minimum number of players required for the card.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Character.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Character.java
index 0b2eafc..baed2bb 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Character.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Character.java
@@ -34,9 +34,11 @@ public abstract class Character extends TribeCard implements Cloneable {
super(Era,false );
this.type = type;
}
+
/**
- * Creates a character card with the specified era and character type.
+ * Creates a character card with the specified image id, era and character type.
*
+ * @param idIMG the image identifier of the character card.
* @param Era the era of the character card.
* @param type the type of the character card.
*/
@@ -58,10 +60,12 @@ public abstract class Character extends TribeCard implements Cloneable {
super(Era,false ,nMin);
this.type = type;
}
+
/**
- * Creates a character card with the specified era, character type,
+ * Creates a character card with the specified image id, era, character type,
* and minimum number of players.
*
+ * @param idIMG the image identifier of the character card.
* @param Era the era of the character card.
* @param type the type of the character card.
* @param nMin the minimum number of players required for the card.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/CharacterType.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/CharacterType.java
index d05a6e6..68f3962 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/CharacterType.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/CharacterType.java
@@ -1,7 +1,5 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
-/**
- * Represents the different types of character cards available in the game.
/**
* Represents the different types of character cards available in the game.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
index 0a4faba..1a4953f 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
@@ -34,6 +34,7 @@ public class Artist extends Character {
/**
* Creates an Artist character card with the specified era.
*
+ * @param idIMG
* @param Era the era of the Artist card
*/
public Artist(String idIMG,int Era) {
@@ -43,6 +44,7 @@ public class Artist extends Character {
/**
* Creates an Artist character card with the specified Era and minimum number of players required to play it.
*
+ * @param idIMG
* @param Era the era of the Artist card
* @param nMin the minimum number of players required for the card
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
index 6025793..58d61eb 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
@@ -89,6 +89,7 @@ public class Builder extends Character {
* Creates a Builder character card with the specified era, reduction value,
* and prestige value.
*
+ * @param idIMG the image identifier of the Builder card.
* @param Era the era of the Builder card.
* @param reductionValue the reduction value of the Builder card.
* @param prestigeValue the prestige value of the Builder card.
@@ -111,6 +112,7 @@ public class Builder extends Character {
* Creates a Builder character card with the specified era, reduction value,
* prestige value, and minimum number of players.
*
+ * @param idIMG the image identifier of the Builder card.
* @param Era the era of the Builder card.
* @param reductionValue the reduction value of the Builder card.
* @param prestigeValue the prestige value of the Builder card.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
index ea20e56..4544a54 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
@@ -34,15 +34,18 @@ public class Gatherer extends Character {
/**
* Creates a Gatherer character card with the specified era.
*
- * @param Era Gatherers era.
+ * @param idIMG the image identifier of the Gatherer card.
+ * @param Era the era of the Gatherer card.
*/
public Gatherer(String idIMG,int Era) {
super(idIMG,Era, CharacterType.GATHERER);
}
/**
- * Creates a Gatherer character card with the specified era and minimum number of players.
+ * Creates a Gatherer character card with the specified image id, era and
+ * minimum number of players.
*
+ * @param idIMG the image identifier of the Gatherer card.
* @param Era the era of the Gatherer card.
* @param nMin the minimum number of players required for the card.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
index 263b99c..b34e8b4 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
@@ -51,9 +51,11 @@ public class Hunter extends Character {
super(Era, CharacterType.HUNTER,nMin);
this.icon = icon;
}
+
/**
- * Creates a Hunter character card with the specified era and icon value.
+ * Creates a Hunter character card with the specified image id, era and icon value.
*
+ * @param idIMG the image identifier of the Hunter card.
* @param Era the era of the Hunter card.
* @param icon the icon value of the Hunter card.
*/
@@ -63,9 +65,10 @@ public class Hunter extends Character {
}
/**
- * Creates a Hunter character card with the specified era, icon value,
+ * Creates a Hunter character card with the specified image id, era, icon value,
* and minimum number of players.
*
+ * @param idIMG the image identifier of the Hunter card.
* @param Era the era of the Hunter card.
* @param icon the icon value of the Hunter card.
* @param nMin the minimum number of players required for the card.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
index 047fa61..15df18f 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
@@ -55,8 +55,9 @@ public class Inventor extends Character {
}
/**
- * Creates an Inventor character card with the specified era and icon value.
+ * Creates an Inventor character card with the specified image id, era and icon value.
*
+ * @param idIMG the image identifier of the Inventor card.
* @param Era the era of the Inventor card.
* @param icon the icon value of the Inventor card.
* @throws IllegalArgumentException if {@code icon < 0} or {@code icon > 9}.
@@ -69,9 +70,10 @@ public class Inventor extends Character {
}
/**
- * Creates an Inventor character card with the specified era, icon value,
+ * Creates an Inventor character card with the specified image id, era, icon value,
* and minimum number of players.
*
+ * @param idIMG the image identifier of the Inventor card.
* @param Era the era of the Inventor card.
* @param icon the icon value of the Inventor card.
* @param nMin the minimum number of players required for the card.
@@ -83,6 +85,7 @@ public class Inventor extends Character {
throw new IllegalArgumentException();
this.icon = icon;
}
+
/**
* Returns the string representation of this Inventor card.
*
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
index 810d669..353e03d 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
@@ -52,9 +52,11 @@ public class Shaman extends Character {
super(Era, CharacterType.SHAMAN,nMin);
this.icon = icon;
}
+
/**
- * Creates a Shaman character card with the specified era and icon value.
+ * Creates a Shaman character card with the specified image id, era and icon value.
*
+ * @param idIMG the image identifier of the Shaman card.
* @param Era the era of the Shaman card.
* @param icon the icon value of the Shaman card.
*/
@@ -64,9 +66,10 @@ public class Shaman extends Character {
}
/**
- * Creates a Shaman character card with the specified era, icon value,
+ * Creates a Shaman character card with the specified image id, era, icon value,
* and minimum number of players.
*
+ * @param idIMG the image identifier of the Shaman card.
* @param Era the era of the Shaman card.
* @param icon the icon value of the Shaman card.
* @param nMin the minimum number of players required for the card.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventCard.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventCard.java
index 34b033d..b92e1c0 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventCard.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventCard.java
@@ -41,9 +41,11 @@ public abstract class EventCard extends TribeCard {
super(Era,true);
this.type = type;
}
+
/**
- * Creates an event card with the specified era and event type.
+ * Creates an event card with the specified image id, era and event type.
*
+ * @param idIMG the image identifier of the event card.
* @param Era the era of the event card.
* @param type the type of the event card.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventType.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventType.java
index c07f869..1b6720a 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventType.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/EventType.java
@@ -1,7 +1,5 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
-/**
- * Represents the different types of event cards available in the game.
/**
* Represents the different types of event cards available in the game.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java
index f0f7716..5d46432 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/CavePaintings.java
@@ -47,9 +47,11 @@ public class CavePaintings extends EventCard {
this.NPrestigeRem = NPrestigeRem;
this.NPrestigeMul = NPrestigeMul;
}
+
/**
- * Creates a CavePaintings event card with the specified era and effect parameters.
+ * Creates a CavePaintings event card with the specified image id, era and effect parameters.
*
+ * @param idIMG the image identifier of the CavePaintings event card.
* @param Era the era of the event card.
* @param NLower the minimum number of Artist cards required to avoid the prestige penalty.
* @param NPrestigeRem the amount of Prestige removed if the player has fewer Artist cards than {@code NLower}.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java
index af57191..a03599b 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Hunt.java
@@ -30,11 +30,13 @@ public class Hunt extends EventCard {
this.foodMultiplier = 1;
this.prestigeMultiplier = prestigeMultiplier;
}
+
/**
* Creates a new Hunt event card.
*
- * @param Era the era of the card
- * @param prestigeMultiplier prestige points multiplicator used during the event
+ * @param idIMG the image identifier of the Hunt event card.
+ * @param Era the era of the card.
+ * @param prestigeMultiplier the prestige points multiplier used during the event.
*/
public Hunt(String idIMG,int Era, int prestigeMultiplier) {
super(idIMG,Era, EventType.HUNT);
@@ -45,7 +47,6 @@ public class Hunt extends EventCard {
/**
* Activates the event card "Hunt".
* Each player takes 1 Food and gains Prestige Points for each Hunter in their tribe.
- *
* Buildings influence:
* Building 7: the player takes 1 Food and 1 additional Prestige Point for each Hunter.
*
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java
index fcbb7e5..6efc4d1 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/ShamanicRitual.java
@@ -34,12 +34,14 @@ public class ShamanicRitual extends EventCard {
this.prestigeToRemove = prestigeToRemove;
}
+
/**
* Creates a new ShamanicRitual event card.
*
- * @param Era the era of the card
- * @param prestigeToAdd prestige points awarded to the player with the most icons
- * @param prestigeToRemove prestige points removed from the player with the fewest icons
+ * @param idIMG the image identifier of the ShamanicRitual event card.
+ * @param Era the era of the card.
+ * @param prestigeToAdd prestige points awarded to the player with the most icons.
+ * @param prestigeToRemove prestige points removed from the player with the fewest icons.
*/
public ShamanicRitual(String idIMG,int Era, int prestigeToAdd, int prestigeToRemove) {
super(idIMG,Era, EventType.SHAMANIC_RITUAL);
@@ -54,7 +56,6 @@ public class ShamanicRitual extends EventCard {
* The player with the fewest icons loses the Prestige Points indicated.
* In case of a tie, all players gain or lose the Prestige Points indicated.
* If all players have the same amount of icons, they all gain and lose Prestige Points.
- *
* Buildings influence:
* Building 2: if you have the lowest number of icons, you don't lose Prestige Points
* Building 5: during the Shamanic Ritual, you gain 3 icons
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java
index 1e20492..51856c3 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Events/Sustenance.java
@@ -39,9 +39,11 @@ public class Sustenance extends EventCard {
super(Era, EventType.SUSTENANCE);
this.PrestigeDebt = PrestigeDebt;
}
+
/**
- * Creates a Sustenance event card with the specified era and prestige debt value.
+ * Creates a Sustenance event card with the specified image id, era and prestige debt value.
*
+ * @param idIMG the image identifier of the Sustenance event card.
* @param Era the era of the event card.
* @param PrestigeDebt the prestige penalty multiplier for unpaid Food units.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Game.java b/src/main/java/it/polimi/ingsw/gc14/Model/Game.java
index 2277dac..e7bca39 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Game.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Game.java
@@ -63,7 +63,13 @@ public class Game implements Serializable {
* The mapping between slots and the players assigned to them.
*/
private HashMap Each value identifies a specific user action, such as adding a player,
- * choosing a slot, drawing a card, picking an optional card, or skipping an
- * optional action.
/**
* Represents the different types of network events that can be sent between
* client and server.
diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java
index 141e01e..4483ea7 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Client/RMIClient.java
@@ -30,13 +30,18 @@ public class RMIClient implements IClient {
/** Client game's controller */
ClientController controller;
+ /**
+ * Local IP address of the RMI client.
+ */
private String myIP;
/**
* Class constructor.
- * @param controller the client controller used to create the callback
- * @param host the host address of the RMI server
- * @param port the port of the RMI server
+ *
+ * @param controller the client controller used to create the callback.
+ * @param host the host address of the RMI server.
+ * @param port the port of the RMI server.
+ * @param myIP the local IP address used by the RMI client.
*/
public RMIClient(ClientController controller, String host, int port, String myIP) {
this.controller=controller;
diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java
index fdcc868..f4889c9 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Network/RMI/Server/RMIServer.java
@@ -54,11 +54,13 @@ public class RMIServer extends UnicastRemoteObject implements IGameServer {
/**
* Class constructor that initializes the attributes.
- * @param controller The game controller
- * @param nPort The RMI port
- * @param actionQueue The action queue
- * @param playerList The player's usernames list
- * @throws RemoteException if an RMI error occurs
+ *
+ * @param controller the game controller.
+ * @param nPort the RMI port.
+ * @param actionQueue the action queue.
+ * @param playerList the players' usernames list.
+ * @param host the host address of the RMI server.
+ * @throws RemoteException if an RMI error occurs.
*/
public RMIServer(GameController controller, int nPort, BlockingQueue If the action is an error, it is sent only to the client associated with
+ * the action username. Otherwise, it is sent to all connected RMI clients.
+ *
+ * @param action the network action to send.
+ * @throws RemoteException if an RMI communication error occurs.
*/
public void notifyAll(NetworkEvent action) throws RemoteException {
for (Map.Entry