Package it.polimi.ingsw.Misc
Class Symbols
java.lang.Object
it.polimi.ingsw.Misc.Symbols
Symbols holds constants and methods used by the CLI. Mainly it focuses on colour management via ANSI codes
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
colorizeBackgroundStudent
(PawnColour p, String message) Method used to create a visual representation of the students using a colour as the background of a String.static String
colorizeStudent
(PawnColour p, String message) Method used to create a visual representation of the students using a colour and the icon.static String
Method used to change the style of a string.static String
Method used to remove all ANSI codes and tabulation from a String.
-
Field Details
-
BLACK
- See Also:
-
WHITE
- See Also:
-
GRAY
- See Also:
-
BLUE
- See Also:
-
GREEN
- See Also:
-
PINK
- See Also:
-
RED
- See Also:
-
YELLOW
- See Also:
-
GOLD
- See Also:
-
RESET
- See Also:
-
BACKGROUND
- See Also:
-
BACKGROUND_BLUE
- See Also:
-
BACKGROUND_GREEN
- See Also:
-
BACKGROUND_PINK
- See Also:
-
BACKGROUND_RED
- See Also:
-
BACKGROUND_YELLOW
- See Also:
-
BOLD
- See Also:
-
OVERLAY
- See Also:
-
PAWN
- See Also:
-
TOWER
- See Also:
-
COIN
- See Also:
-
-
Constructor Details
-
Symbols
public Symbols()
-
-
Method Details
-
colorizeStudent
Method used to create a visual representation of the students using a colour and the icon. Extends the functionality of the methodcolour(String, String)
- Parameters:
p
- student object used to access colour informationmessage
- the icon or character with which the student will be represented- Returns:
- a String containing the ASCII code of the colour followed by the message
-
colour
Method used to change the style of a string. It is usually used to change the colour of the string but can be used to change other aspect of the style in general- Parameters:
s
- the String of which we want to change the stylecolour
- the ANSI code with which the String style will be modified- Returns:
- a String with style changed
-
colorizeBackgroundStudent
Method used to create a visual representation of the students using a colour as the background of a String.- Parameters:
p
- student object used to access colour informationmessage
- the icon or character with which the student will be represented- Returns:
- a String containing the ASCII code of the colour followed by the message
-
stripFromANSICodes
Method used to remove all ANSI codes and tabulation from a String. Useful to count character within a String which has its style affected by ANSI codes- Parameters:
s
- the message which the ANSI code will be stripped from- Returns:
- a simple ASCII String
-