Class 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 Detail

      • GameService

        public GameService()
    • 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)
      • listRules

        @GET
        @Path("/listRules")
        @Produces("application/json")
        public Vector<String> listRules()
      • listInitialBoards

        @GET
        @Path("/listInitialBoards")
        @Produces("application/json")
        public Vector<String> listInitialBoards()