Class TextRenderer

java.lang.Object
za.co.wethinkcode.robots.rendering.Renderer
za.co.wethinkcode.robots.rendering.TextRenderer
Direct Known Subclasses:
ClientTextRenderer, ServerRenderer

public class TextRenderer extends Renderer
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 Details

    • RENDER_OUTPUT

      public static OutputStream RENDER_OUTPUT
      Standard output unless reassigned
    • dbg

      public static DebugLevel dbg
      Standard output unless reassigned
  • Constructor Details

    • TextRenderer

      public TextRenderer()
  • Method Details

    • newRobotConnectionReceivedCopy

      public static void newRobotConnectionReceivedCopy(Socket socket)
      Immediately renders the copy for a new robot connection being received.
    • logWorldCreation

      public static void logWorldCreation(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 console
      Parameters:
      world - the world being rendered
    • renderAnInternalDebugMessage

      public static void renderAnInternalDebugMessage(String message)
      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

      public static void renderANetworkMessage(String message)
    • renderAnInternalErrorMessage

      public static void renderAnInternalErrorMessage(String message)
      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

      public static void renderAnInternalErrorMessage(Exception e)
    • renderMessage

      public static void renderMessage(String message, Ansi_Styling colour)
      Take in a message and render it in the given colour
      Parameters:
      message - the message being rendered
      colour - the colour the message will have
    • renderMessage

      public static void renderMessage(String message)
      Take in a message render it to the screen
      Parameters:
      message - the message being rendered
    • customPrintln

      public static void customPrintln(OutputStream stream, String styled, String og)
      Custom implementation of println that can route to external outputs if needed
      Parameters:
      stream - output stream
      styled - message
    • customPrintln

      public static void customPrintln(OutputStream stream, String styled)