Class Client

java.lang.Object
za.co.wethinkcode.robots.client.Client

public class Client extends Object
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args)
    • getScanner

      public Scanner getScanner()
      The scanner this robot is using
    • getClientOptions

      public ClientOptions getClientOptions()
      Returns:
      the Picocli options for this client
    • getParser

      public CliParser getParser()
      Returns:
      the CliParser being used
    • validatePort

      public int validatePort(Integer selectedPort)
      Validate that the given port is within the acceptable range of port numbers
      Parameters:
      selectedPort - the port given by clientOptions
      Returns:
      a valid port number
    • validateIp

      public String validateIp(String ipAddress)
    • getIpAddress

      public String getIpAddress()
    • getPort

      public Integer getPort()
    • setHandler

      public void setHandler(ClientHandler handler)
    • getMemory

      public Memory getMemory()
    • start

      public void start()
    • applyMuteFlag

      public void applyMuteFlag(String[] args)
      Apply the mute flag from CLI args: disables all audio for testing/headless.
      Parameters:
      args - the original CLI arguments passed to main
    • isAudioMuted

      public boolean isAudioMuted()
      Returns:
      true if audio is muted
    • receiveFromGUI

      public void receiveFromGUI(String message) throws IOException, ExecutionException, InterruptedException
      Throws:
      IOException
      ExecutionException
      InterruptedException