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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
drawDiningRoomRow
(PawnColour rowColour, PlayerBoard p, GameMode gameMode) It draws a dining room's row with its related students and the not yet obtained coinsstatic String
drawEntrance
(PlayerBoard pb, Model gb) It draws a representation of the entrance of the provided player.static String
drawPlayerBoard
(PlayerBoard playerBoard, Model ctx) It draws a representation of thePlayerBoard
of the provided player.static String
drawTeacher
(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 String
drawTowers
(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 thePlayerBoard
of the provided player.- Parameters:
playerBoard
- thePlayerBoard
which 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
- thePlayerBoard
to 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
- thePlayerBoard
to 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
- thePlayerBoard
to 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 specificPawnColour
of the teacher to be representedp
- thePlayerBoard
to 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
-