Package edu.wisc.game.rest
Class GameService2
- java.lang.Object
-
- edu.wisc.game.rest.GameService2
-
- Direct Known Subclasses:
CheckPlanService,GameService2Html
@Path("/GameService2") public class GameService2 extends ObjectThe "Second Batch" of API calls, primarily for use with players constrained by an experiment plan, and playing a sequence of games as outlined in the trial list to which the player is assigned. This API is set up in accordance with Kevin Mui's request, 2020-08-17.
-
-
Constructor Summary
Constructors Constructor Description GameService2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActivateBonusWrapperactivateBonus(String playerId)ColorMapcolorMap()Returns a hash map that maps each color name (in upper case) to a vector of 3 integers, representing RGB values.PlayerResponsedebug(String playerId, String exp)Episode.Displaydisplay(String episodeId)StringgetVersion()Reports the current version of the serverGiveUpWrappergiveUp(String playerId, int seriesNo)FileWriteReportguess(String episodeId, String text, int confidence)Records a player's guess about the rules.ListShapesWrapperlistShapes()Lists the names of all shapes.NewEpisodeWrapper2mostRecentEpisode(String playerId)Episode.Displaymove(String episodeId, int x, int y, int cnt)Episode.Displaymove(String episodeId, int x, int y, int bx, int by, int cnt)NewEpisodeWrapper2newEpisode(String playerId, boolean activateBonus, boolean giveUp)PlayerResponseplayer(String playerId, String exp)
-
-
-
Method Detail
-
player
@POST @Path("/player") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public PlayerResponse player(@FormParam("playerId") String playerId, @DefaultValue("null") @FormParam("exp") String exp)
-
mostRecentEpisode
@POST @Path("/mostRecentEpisode") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public NewEpisodeWrapper2 mostRecentEpisode(@FormParam("playerId") String playerId)
-
newEpisode
@POST @Path("/newEpisode") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public NewEpisodeWrapper2 newEpisode(@FormParam("playerId") String playerId, @DefaultValue("false") @FormParam("activateBonus") boolean activateBonus, @DefaultValue("false") @FormParam("giveUp") boolean giveUp)
-
display
@GET @Path("/display") @Produces("application/json") public Episode.Display display(@QueryParam("episode") String episodeId)
-
move
@POST @Path("/move") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public Episode.Display move(@FormParam("episode") String episodeId, @FormParam("x") int x, @FormParam("y") int y, @FormParam("bx") int bx, @FormParam("by") int by, @FormParam("cnt") int cnt)
-
move
@POST @Path("/pick") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public Episode.Display move(@FormParam("episode") String episodeId, @FormParam("x") int x, @FormParam("y") int y, @FormParam("cnt") int cnt)
-
activateBonus
@POST @Path("/activateBonus") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public ActivateBonusWrapper activateBonus(@FormParam("playerId") String playerId)
-
giveUp
@POST @Path("/giveUp") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public GiveUpWrapper giveUp(@FormParam("playerId") String playerId, @FormParam("seriesNo") int seriesNo)
-
debug
@GET @Path("/debug") @Produces("application/json") public PlayerResponse debug(@QueryParam("playerId") String playerId, @DefaultValue("null") @QueryParam("exp") String exp)
-
guess
@POST @Path("/guess") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public FileWriteReport guess(@FormParam("episode") String episodeId, @FormParam("data") String text, @DefaultValue("-1") @FormParam("confidence") int confidence)Records a player's guess about the rules. This is typically used at the end of an episode.
-
colorMap
@GET @Path("/colorMap") @Produces("application/json") public ColorMap colorMap()Returns a hash map that maps each color name (in upper case) to a vector of 3 integers, representing RGB values. The data come from the file in game-data/colors. Note that calling this method causes the system to re-read the file; so the client may want to cache the data.
-
listShapes
@GET @Path("/listShapes") @Produces("application/json") public ListShapesWrapper listShapes()Lists the names of all shapes. This can be used e.g. in a board editor.
-
getVersion
@GET @Path("/getVersion") @Produces("application/json") public String getVersion()Reports the current version of the server
-
-