Package it.polimi.ingsw.Client.CLI
Class PlayerBoardUI
java.lang.Object
it.polimi.ingsw.Client.CLI.PlayerBoardUI
PlayerBoardUI allows to print all the information representing the
It exposes multiple methods to render the individual components independently and one method to combine them all in a single component.
PlayerBoard.
It exposes multiple methods to render the individual components independently and one method to combine them all in a single component.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdrawDiningRoomRow(PawnColour rowColour, PlayerBoard p, GameMode gameMode) It draws a dining room's row with its related students and the not yet obtained coinsstatic StringdrawEntrance(PlayerBoard pb, Model gb) It draws a representation of the entrance of the provided player.static StringdrawPlayerBoard(PlayerBoard playerBoard, Model ctx) It draws a representation of thePlayerBoardof the provided player.static StringdrawTeacher(PawnColour teacher, PlayerBoard p, Model gb) A single teacher will be represented with the standard UI representation of the pawn piece or an empty space if the player has not conquered that specific teacher yet.static StringdrawTowers(PlayerBoard p, Model gb) It draws a representation of the tower storage of the provided player.
-
Constructor Details
-
PlayerBoardUI
public PlayerBoardUI()
-
-
Method Details
-
drawPlayerBoard
It draws a representation of thePlayerBoardof the provided player.- Parameters:
playerBoard- thePlayerBoardwhich will be representedctx- reference to the model used to check the available coins left in the game- Returns:
- the complete player board UI component
-
drawEntrance
It draws a representation of the entrance of the provided player.- Parameters:
pb- thePlayerBoardto which the entrance should be associated withgb- reference to the model used to add padding in the entrance when 2 or 4 players are in the game because they have less students in the entrance than 3 players' game- Returns:
- the unused students in a multiline dual column layout String representation
-
drawTowers
It draws a representation of the tower storage of the provided player.- Parameters:
p- thePlayerBoardto which the towers should be associated withgb- reference to the model used to check the relationship between towers and player- Returns:
- the unused towers in a multiline dual column layout String representation
-
drawDiningRoomRow
It draws a dining room's row with its related students and the not yet obtained coins- Parameters:
rowColour- the dining room's row which should be printedp- thePlayerBoardto which the dining room should be associated withgameMode- reference to the model used to add coin representation if in correct settings- Returns:
- a fixed length line containing all the students on the specific dining room's row
-
drawTeacher
A single teacher will be represented with the standard UI representation of the pawn piece or an empty space if the player has not conquered that specific teacher yet.- Parameters:
teacher- the specificPawnColourof the teacher to be representedp- thePlayerBoardto which the teacher should be associated withgb- reference to the model used to check the relationship between teacher and player- Returns:
- single line containing teacher
-