Class ColorController

java.lang.Object
org.bamboomy.c44.rest.ColorController

@CrossOrigin(origins="http://localhost/", maxAge=3600L) @RestController @RequestMapping("/color/") public class ColorController extends Object
This class handles the negotiation for the color.
  • Method Details

    • askGame

      @GetMapping("/askGame/{identifierHash}") public String askGame(@PathVariable("identifierHash") String identifierHash)
      Asks which games are available for the given "identifierHash".
      Parameters:
      identifierHash - the (unique) identifierHash which identifies the robot.
      Returns:
      A valid game hash.
    • askColors

      @GetMapping("/askColors/{gameHash}/{identifierHash}") public String askColors(@PathVariable("gameHash") String gameHash, @PathVariable("identifierHash") String identifierHash)
      Requests the colors for the given game and identifierHash.
      Parameters:
      gameHash - the gameHash
      identifierHash - the identifierHash
      Returns:
      the colors
    • askHash

      @GetMapping("/askHash/{gameHash}/{color}/{identifierHash}") public String askHash(@PathVariable("gameHash") String gameHash, @PathVariable("color") String color, @PathVariable("identifierHash") String identifierHash)
      Returns (and generates) the player hash for given game, color and identifier.
      Parameters:
      gameHash - the gameHash
      color - the color
      identifierHash - the identifierHash
      Returns:
      the player hash
    • goToNextGame

      @GetMapping("/goToNextGame") public static String goToNextGame()
      (Deprecated) call to go to the next game. Retained for legacy reasons, will not be present and can be ignored.
      Returns:
      a vanilla "ok" message.
    • robotPlay

      @GetMapping("/robotPlay") public boolean robotPlay()
      Asks whether the server is booted in robotplay (or human play).
      Returns:
      A boolean whether the server is booted in robotplay.