Class TextRenderer
java.lang.Object
za.co.wethinkcode.robots.rendering.Renderer
za.co.wethinkcode.robots.rendering.TextRenderer
- Direct Known Subclasses:
ClientTextRenderer,ServerRenderer
This class encapsulates all generic text rendering behavior
Most methods contained in this class are void methods that print statements to render the TUI
All of these are designed to be pure render methods, causing no state mutations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DebugLevelStandard output unless reassignedstatic OutputStreamStandard output unless reassignedFields inherited from class za.co.wethinkcode.robots.rendering.Renderer
GUI_WINDOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcustomPrintln(OutputStream stream, String styled) static voidcustomPrintln(OutputStream stream, String styled, String og) Custom implementation of println that can route to external outputs if neededstatic voidlogWorldCreation(World world) Log the specs of a world when it is created, printing out its specifications, as well as a picture to the server admin consolestatic voidnewRobotConnectionReceivedCopy(Socket socket) Immediately renders the copy for a new robot connection being received.static voidrenderANetworkMessage(String message) static voidrenderAnInternalDebugMessage(com.google.gson.JsonObject obj) Overload of internal Debug Message to take in a JSON objectstatic voidrenderAnInternalDebugMessage(String message) Take in a debug message that does not break the program but the server operator should be aware ofstatic voidstatic voidrenderAnInternalErrorMessage(String message) Take in an error that does not break the program but the server operator should be aware ofstatic voidrenderMessage(String message) Take in a message render it to the screenstatic voidrenderMessage(String message, Ansi_Styling colour) Take in a message and render it in the given colourMethods inherited from class za.co.wethinkcode.robots.rendering.Renderer
updateRenderer
-
Field Details
-
RENDER_OUTPUT
Standard output unless reassigned -
dbg
Standard output unless reassigned
-
-
Constructor Details
-
TextRenderer
public TextRenderer()
-
-
Method Details
-
newRobotConnectionReceivedCopy
Immediately renders the copy for a new robot connection being received. -
logWorldCreation
Log the specs of a world when it is created, printing out its specifications, as well as a picture to the server admin console- Parameters:
world- the world being rendered
-
renderAnInternalDebugMessage
Take in a debug message that does not break the program but the server operator should be aware of- Parameters:
message- the message being rendered
-
renderAnInternalDebugMessage
public static void renderAnInternalDebugMessage(com.google.gson.JsonObject obj) Overload of internal Debug Message to take in a JSON object- Parameters:
obj- the JSON being rendered.
-
renderANetworkMessage
-
renderAnInternalErrorMessage
Take in an error that does not break the program but the server operator should be aware of- Parameters:
message- the message being rendered
-
renderAnInternalErrorMessage
-
renderMessage
Take in a message and render it in the given colour- Parameters:
message- the message being renderedcolour- the colour the message will have
-
renderMessage
Take in a message render it to the screen- Parameters:
message- the message being rendered
-
customPrintln
Custom implementation of println that can route to external outputs if needed- Parameters:
stream- output streamstyled- message
-
customPrintln
-