Class ServerRenderer

java.lang.Object
za.co.wethinkcode.robots.server.rendering.ServerRenderer

public class ServerRenderer extends Object
This class encapsulates all rendering behavior on the server side

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.

  • Constructor Details

    • ServerRenderer

      public ServerRenderer()
  • Method Details

    • displayMazeAsIBM437

      public static void displayMazeAsIBM437(Maze maze)
      Take in a maze and print it in IBM437 format

      Please note that this internally utilizes the Maze.numbersConstructor internally, and is subject to potential depreciation

      Parameters:
      maze - the maze being rendered
    • connectToServerTicket

      public static void connectToServerTicket(WorldConfig config, String ipAddress)
      Renders the connect to server ticket display based on an IP address invalid input: '&' config
      Parameters:
      config - the world config being referenced
      ipAddress - the ip address the server is hosted on
    • newRobotConnectionReceivedCopy

      public static void newRobotConnectionReceivedCopy()
      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.
    • 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, ServerRenderer.Colour 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
    • printWorld

      public static void printWorld(World world)
    • enterServerCommand

      public static void enterServerCommand()
      Prompt message for a Server Command to be entered
    • getRobotSymbol

      public static String getRobotSymbol(Robot robot)