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.Display
display(String episodeId)
Board
getBoard(String id)
Gets a Board object by IDBoard
getBoard1()
Board
getBoard2()
String
getHello1()
Prints Hello: edu.wisc.game.sql.Board@3692d23fString
getHello2()
ParaSet
getParam(String name)
Gets the entire parameter set, identified by nameString
getParamHtml(String name)
Gets the entire parameter set, identified by namePiece
getPiece1()
Piece
getPiece2()
Vector<String>
listInitialBoards()
Vector<String>
listRules()
Episode.Display
move(String episodeId, int x, int y, int bx, int by, int cnt)
NewEpisodeWrapper
newEpisode(String rules, int pieces, int shapes, int colors, String boardName)
Board
saveBoard(Board b)
PlayerResponse
startTrial(String playerId, String exp)
FileWriteReport
writeFile(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
-