Package edu.wisc.game.rest
Class GameService
java.lang.Object
edu.wisc.game.rest.GameService
- Direct Known Subclasses:
GameServiceHtml
The "First Batch" of API calls, primarily for use in the research environment, where a player can choose any game to play
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a Board object by IDPrints Hello: edu.wisc.game.sql.Board@3692d23fnewEpisode
(String rules, int pieces, int shapes, int colors, String boardName) Gets the entire parameter set, identified by namestartTrial
(String playerId, String exp) Writes an arbitrary file to somewhere within the saved files directory.
-
Constructor Details
-
GameService
public GameService()
-
-
Method Details
-
getPiece1
-
getPiece2
-
getBoard1
-
getBoard2
-
getHello1
Prints Hello: edu.wisc.game.sql.Board@3692d23f -
getHello2
-
getBoard
@POST @Path("/getBoard") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public Board getBoard(@FormParam("id") String id) Gets a Board object by ID- Returns:
- The matching Board object, or null if none found
-
saveBoard
-
writeFile
@POST @Path("/writeFile") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public FileWriteReport writeFile(@FormParam("dir") String dir, @FormParam("file") String file, @FormParam("append") String appendString, @FormParam("data") String data) Writes an arbitrary file to somewhere within the saved files directory. One probably should not use this method, since there are other, specialized, methods for writing files of standards types. -
newEpisode
@POST @Path("/newEpisode") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public NewEpisodeWrapper newEpisode(@FormParam("rules") String rules, @DefaultValue("0") @FormParam("pieces") int pieces, @DefaultValue("0") @FormParam("shapes") int shapes, @DefaultValue("0") @FormParam("colors") int colors, @DefaultValue("null") @FormParam("board") String boardName) Gets the entire parameter set, identified by name -
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) -
startTrial
@POST @Path("/startTrial") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public PlayerResponse startTrial(@FormParam("playerId") String playerId, @DefaultValue("null") @FormParam("exp") String exp) -
listRules
-
listInitialBoards
-