Merge pull request #65 from rubenpirreram/javadoc-fixes
Fix: ClientContrioller JavaDOC
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.Building;
|
||||
|
||||
public enum EffectType {
|
||||
FINAL, CARD_SET,INVENTOR_PAIR, ON_EVENT , ON_END_TURN, ON_ROUND_END
|
||||
FINAL, CARD_SET, INVENTOR_PAIR, ON_EVENT, ON_END_TURN, ON_ROUND_END
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
|
||||
|
||||
public enum CharacterType {
|
||||
INVENTOR,BUILDER, GATHERER,ARTIST,SHAMAN,HUNTER
|
||||
INVENTOR, BUILDER, GATHERER, ARTIST, SHAMAN, HUNTER
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ public class Game implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* The current number of players.
|
||||
* Returns the current number of players participating in the game.
|
||||
* @return the current number of players.
|
||||
*/
|
||||
public int getCurrentPlayerNumber() {
|
||||
return playersList.size();
|
||||
@@ -318,6 +319,18 @@ public class Game implements Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the upper card draw for the specified player when no drawable cards are available.
|
||||
* The operation succeeds only if the current game stage is {@code RESOLVING_ACTIONS},
|
||||
* the specified player is the current player, at least one upper draw is still available,
|
||||
* and there are no drawable upper tribe cards (i.e. all remaining upper tribe cards are event cards)
|
||||
* and no upper building cards that the player can afford.
|
||||
* If successful, the upper draw counter is decremented.
|
||||
* If both upper and lower draws become zero (or no cards remain drawable), the next player setup is triggered.
|
||||
*
|
||||
* @param player the player skipping the upper draw.
|
||||
* @return {@code true} if the skip succeeds, {@code false} otherwise.
|
||||
*/
|
||||
public boolean SkipUpperDrawing(Player player) {
|
||||
if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS)
|
||||
{
|
||||
@@ -337,6 +350,18 @@ public class Game implements Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the lower card draw for the specified player when no drawable cards are available.
|
||||
* The operation succeeds only if the current game stage is {@code RESOLVING_ACTIONS},
|
||||
* the specified player is the current player, at least one lower draw is still available,
|
||||
* and there are no drawable lower tribe cards (i.e. all remaining lower tribe cards are event cards)
|
||||
* and no lower building cards that the player can afford.
|
||||
* If successful, the lower draw counter is decremented.
|
||||
* If both upper and lower draws become zero (or no cards remain drawable), the next player setup is triggered.
|
||||
*
|
||||
* @param player the player skipping the lower draw.
|
||||
* @return {@code true} if the skip succeeds, {@code false} otherwise.
|
||||
*/
|
||||
public boolean SkipLowerDrawing(Player player) {
|
||||
if(currentState.getGameStage()!= GameStages.RESOLVING_ACTIONS)
|
||||
{
|
||||
@@ -696,13 +721,32 @@ public class Game implements Serializable {
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
/**
|
||||
* Checks whether there are any drawable lower tribe cards on the board,
|
||||
* i.e. lower tribe cards that are not event cards.
|
||||
*
|
||||
* @return {@code true} if at least one non-event lower tribe card is available, {@code false} otherwise.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether there are any drawable upper tribe cards on the board,
|
||||
* i.e. upper tribe cards that are not event cards.
|
||||
*
|
||||
* @return {@code true} if at least one non-event upper tribe card is available, {@code false} otherwise.
|
||||
*/
|
||||
private boolean hasDrawableUp()
|
||||
{
|
||||
return getUpperListTribeCards().stream().filter(x-> !x.IsEventCard()).count()!=0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether there are any drawable lower tribe cards on the board,
|
||||
* i.e. lower tribe cards that are not event cards.
|
||||
*
|
||||
* @return {@code true} if at least one non-event lower tribe card is available, {@code false} otherwise.
|
||||
*/
|
||||
private boolean hasDrawableDown()
|
||||
{
|
||||
return getLowerListTribeCards().stream().filter(x-> !x.IsEventCard()).count()!=0;
|
||||
@@ -817,6 +861,14 @@ public class Game implements Serializable {
|
||||
public String toString() {
|
||||
return PlayersStamp()+"\n"+BoardStamp()+"\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of all the players currently in the game,
|
||||
* arranged side by side in pairs.
|
||||
* If the number of players is odd, the last player is printed on its own line.
|
||||
*
|
||||
* @return {@code String} - a string representation of all the players.
|
||||
*/
|
||||
public String PlayersStamp()
|
||||
{
|
||||
StringBuilder stringBuilder=new StringBuilder();
|
||||
@@ -832,6 +884,14 @@ public class Game implements Serializable {
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the board, including the current state,
|
||||
* the offer track with slot assignments, the upper and lower tribe card lists,
|
||||
* and the upper and lower building card lists.
|
||||
*
|
||||
* @return {@code String} - a string representation of the board.
|
||||
*/
|
||||
public String BoardStamp()
|
||||
{
|
||||
var offerTrack = new AsciiTable(BorderStyle.UNICODE, slotMap.size());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package it.polimi.ingsw.gc14.Model.GamePackage;
|
||||
|
||||
public enum GameStages {
|
||||
WAITING,SLOT_CHOICE, RESOLVING_ACTIONS, OPTIONAL_CARD_EFFECT, RESOLVING_EVENT,ENDING,ENDED
|
||||
WAITING, SLOT_CHOICE, RESOLVING_ACTIONS, OPTIONAL_CARD_EFFECT, RESOLVING_EVENT, ENDING, ENDED
|
||||
}
|
||||
|
||||
@@ -52,10 +52,14 @@ public class Order2 extends OrderLogicCard {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the TURN ORDER box of the TUI.
|
||||
* @return the string containing the box
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
var table = new AsciiTable(BorderStyle.UNICODE, 2);
|
||||
List<String> stringUp=new ArrayList<>();
|
||||
for(int i=0;i<2;i++)
|
||||
|
||||
@@ -53,6 +53,11 @@ public class Order3 extends OrderLogicCard {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the TURN ORDER box of the TUI.
|
||||
* @return the string containing the box
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
@@ -60,6 +60,11 @@ public class Order4 extends OrderLogicCard {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the TURN ORDER box of the TUI.
|
||||
* @return the string containing the box
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
@@ -61,6 +61,11 @@ public class Order5 extends OrderLogicCard {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the TURN ORDER box of the TUI.
|
||||
* @return the string containing the box
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
@@ -17,6 +17,10 @@ public class OrderPlayer implements Serializable {
|
||||
this.player=player;
|
||||
this.played=played;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the string containing the username and whether it played or not.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return player.getUserName()+" "+played;
|
||||
|
||||
Reference in New Issue
Block a user