s3games.robot

## Class Camera

- java.lang.Object
- - s3games.robot.Camera

- All Implemented Interfaces:
    java.lang.Runnable

      public class Camera
      extends java.lang.Object
      implements java.lang.Runnable

  Camera singleton is an object that communicates with the C++ application to retrieve the locations of the elements on the real board. The communication is done through a redirected standard input/output of the C++ application.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `Camera.DetectedObject` represents an object that has been detected by the camera

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Camera(GameSpecification specs)` construct a new camera controller, it will also construct a camera control window.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` close all the camera-related stuff
    `void` | `msgToUser(java.lang.String msg)` appends a new message to the camera control panel window - a gateway for camera player
    `void` | `requestObjectsFromCamera()` sends a command to the C++ application to make a snapshot of the current game situation and send a list of detected objects
    `void` | `run()` the communicating thread - blocking reads from the C++ application and processes the received packets
    `java.util.ArrayList<Camera.DetectedObject>` | `waitForUserMove()` the camera player indicates to the camera object by calling this blocking method that it is interested in obtaining the current state of the game from the camera immediately

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Camera

          public Camera(GameSpecification specs)

      construct a new camera controller, it will also construct a camera control window.

  - ### Method Detail

    - #### run

          public void run()

      the communicating thread - blocking reads from the C++ application and processes the received packets
      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### requestObjectsFromCamera

          public void requestObjectsFromCamera()

      sends a command to the C++ application to make a snapshot of the current game situation and send a list of detected objects

    - #### waitForUserMove

          public java.util.ArrayList<Camera.DetectedObject> waitForUserMove()

      the camera player indicates to the camera object by calling this blocking method that it is interested in obtaining the current state of the game from the camera immediately

    - #### msgToUser

          public void msgToUser(java.lang.String msg)

      appends a new message to the camera control panel window - a gateway for camera player

    - #### close

          public void close()

      close all the camera-related stuff