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 Summary
Modifier and TypeMethodDescriptionRequests the colors for the given game and identifierHash.Asks which games are available for the given "identifierHash".Returns (and generates) the player hash for given game, color and identifier.static String(Deprecated) call to go to the next game.booleanAsks whether the server is booted in robotplay (or human play).
-
Method Details
-
askGame
-
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 gameHashidentifierHash- 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 gameHashcolor- the coloridentifierHash- the identifierHash- Returns:
- the player hash
-
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.
-