src/main/java/com/webcheckers/ui/GetGameRoute.java
@Override
    public Object handle(Request request, Response response) {

        LOG.finer("GetGameRoute is invoked.");
        final Session httpSession = request.session();
        final Player redPlayer = (Player) httpSession.attribute(RED_PLAYER);
        final Player currentPlayer = (Player) httpSession.attribute(CURRENT_USER);
        final Player whitePlayer = (Player) httpSession.attribute(WHITE_PLAYER);
        if (httpSession.attribute(CURRENT_USER).equals(whitePlayer)){
            board.flipOrientation();
        }
        // TODO
        final Map<String, Object> modeOptionsAsJSON = new HashMap(2);
        Map<String, Object> vm = new HashMap<>();
        vm.put("title", "Game page");
        vm.put("message", Message.info("Hi"));

        if (currentPlayer.inGame() == true)
        {

        }
        vm.put(VIEW_MODE, "PLAY");
        vm.put(CURRENT_USER, currentPlayer);
        vm.put(RED_PLAYER, redPlayer);
        vm.put(WHITE_PLAYER, whitePlayer);
        vm.put(ACTIVE_COLOR, piece.getColor());
        vm.put(BOARD, board.iterator());
        return templateEngine.render(new ModelAndView(vm, GAME_TEMPLATE));
    }
/**
     * Handle a request for a game
     *
     * @param request the HTTP request; request for user, game ID
     * @param response the HTTP response
     * @return rendered game
     */
Handle a request for a game

@param request the HTTP request; request for user, game ID
@param response the HTTP response
@return rendered game
Handle a request for a game @param request the HTTP request ; request for user game ID @param response the HTTP response @return rendered game
@Override
    public Object handle(Request request, Response response) {
        LOG.finer("GetGameRoute is invoked.");
        final Session httpSession = request.session();
        final Player redPlayer = (Player) httpSession.attribute(RED_PLAYER);
        final Player currentPlayer = (Player) httpSession.attribute(CURRENT_USER);
        final Player whitePlayer = (Player) httpSession.attribute(WHITE_PLAYER);
        if (httpSession.attribute(CURRENT_USER).equals(whitePlayer)){
            board.flipOrientation();
        }
        final Map<String, Object> modeOptionsAsJSON = new HashMap(2);
        Map<String, Object> vm = new HashMap<>();
        vm.put("title", "Game page");
        vm.put("message", Message.info("Hi"));
        if (currentPlayer.inGame() == true)
        {
        }
        vm.put(VIEW_MODE, "PLAY");
        vm.put(CURRENT_USER, currentPlayer);
        vm.put(RED_PLAYER, redPlayer);
        vm.put(WHITE_PLAYER, whitePlayer);
        vm.put(ACTIVE_COLOR, piece.getColor());
        vm.put(BOARD, board.iterator());
        return templateEngine.render(new ModelAndView(vm, GAME_TEMPLATE));
    }
@ Override public Object handle ( Request request , Response response ) { LOG . finer ( "GetGameRoute is invoked." ) ; final Session httpSession = request . session ( ) ; final Player redPlayer = ( Player ) httpSession . attribute ( RED_PLAYER ) ; final Player currentPlayer = ( Player ) httpSession . attribute ( CURRENT_USER ) ; final Player whitePlayer = ( Player ) httpSession . attribute ( WHITE_PLAYER ) ; if ( httpSession . attribute ( CURRENT_USER ) . equals ( whitePlayer ) ) { board . flipOrientation ( ) ; } final Map < String , Object > modeOptionsAsJSON = new HashMap ( 2 ) ; Map < String , Object > vm = new HashMap < > ( ) ; vm . put ( "title" , "Game page" ) ; vm . put ( "message" , Message . info ( "Hi" ) ) ; if ( currentPlayer . inGame ( ) == true ) { } vm . put ( VIEW_MODE , "PLAY" ) ; vm . put ( CURRENT_USER , currentPlayer ) ; vm . put ( RED_PLAYER , redPlayer ) ; vm . put ( WHITE_PLAYER , whitePlayer ) ; vm . put ( ACTIVE_COLOR , piece . getColor ( ) ) ; vm . put ( BOARD , board . iterator ( ) ) ; return templateEngine . render ( new ModelAndView ( vm , GAME_TEMPLATE ) ) ; }
Handle a request for a game
Handle a request for a game
// TODO
