Package edu.wisc.game.rest
Class GameService
java.lang.Object
edu.wisc.game.rest.GameService
- Direct Known Subclasses:
GameServiceHtml
@Path("/GameService")
public class GameService
extends Object
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 Constructor Description GameService() -
Method Summary
Modifier and Type Method Description Episode.Displaydisplay(String episodeId)BoardgetBoard(String id)Gets a Board object by IDBoardgetBoard1()BoardgetBoard2()StringgetHello1()Prints Hello: edu.wisc.game.sql.Board@3692d23fStringgetHello2()ParaSetgetParam(String name)Gets the entire parameter set, identified by nameStringgetParamHtml(String name)Gets the entire parameter set, identified by namePiecegetPiece1()PiecegetPiece2()Vector<String>listInitialBoards()Vector<String>listRules()Episode.Displaymove(String episodeId, int x, int y, int bx, int by, int cnt)NewEpisodeWrappernewEpisode(String rules, int pieces, int shapes, int colors, String boardName)BoardsaveBoard(Board b)PlayerResponsestartTrial(String playerId, String exp)FileWriteReportwriteFile(String dir, String file, String appendString, String data)
-
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) -
getParam
@GET @Path("/getParaSet") @Produces("application/json") public ParaSet getParam(@QueryParam("name") String name)Gets the entire parameter set, identified by name -
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) -
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
-
getParamHtml
@GET @Path("/getParaSetHtml") @Produces("text/html") public String getParamHtml(@QueryParam("name") String name)Gets the entire parameter set, identified by name
-