src/main/java/com/webcheckers/ui/PostBackUpMoveRoute.java
// at the beginning of the turn.
at the beginning of the turn.
at the beginning of the turn .
@Override
    public Object handle(Request request, Response response) throws Exception {
        final Session httpSession = request.session();
        Gson gson = new Gson();
        Game game = Application.gameCenter.getGameByPlayer(httpSession.attribute("Player"));
        boolean b = game.backUp();
        Message message;
        if (b) {
            message = Message.info("Move Backed Up.");
        } else {
            message = Message.error("Cannot Back Up Move.");
        }
        String jsonMessage = gson.toJson(message);
        response.body(jsonMessage);
        return jsonMessage;
    }
@ Override public Object handle ( Request request , Response response ) throws Exception { final Session httpSession = request . session ( ) ; Gson gson = new Gson ( ) ; Game game = Application . gameCenter . getGameByPlayer ( httpSession . attribute ( "Player" ) ) ; boolean b = game . backUp ( ) ; Message message ; if ( b ) { message = Message . info ( "Move Backed Up." ) ; } else { message = Message . error ( "Cannot Back Up Move." ) ; } String jsonMessage = gson . toJson ( message ) ; response . body ( jsonMessage ) ; return jsonMessage ; }
at the beginning of the turn.
at the beginning of the turn .
//String jsonMove = request.queryParams("actionData");