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
All Methods Instance Methods Concrete Methods 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()
Piece
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)
Gets the entire parameter set, identified by nameBoard
saveBoard(Board b)
PlayerResponse
startTrial(String playerId, String exp)
FileWriteReport
writeFile(String dir, String file, String appendString, String data)
Writes an arbitrary file to somewhere within the saved files directory.
-
-
-
Method Detail
-
getPiece1
@GET @Path("/pieceX") @Produces("application/xml") public Piece getPiece1()
-
getPiece2
@GET @Path("/piece") @Produces("application/json") public Piece getPiece2()
-
getBoard1
@GET @Path("/boardX") @Produces("application/xml") public Board getBoard1()
-
getBoard2
@GET @Path("/board") @Produces("application/json") public Board getBoard2()
-
getHello1
@GET @Path("/hello1") @Produces("application/json") public String getHello1()
Prints Hello: edu.wisc.game.sql.Board@3692d23f
-
getHello2
@GET @Path("/hello2") @Produces("application/json") public String 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
@POST @Path("/saveBoard") @Consumes("application/json") @Produces("application/json") public Board saveBoard(Board b)
-
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)
-
-