Package com.poker.game

Examples of com.poker.game.Player


    public void notification(@WebModel Map m, @WebParam("room") String room, RequestContext rc) {
        Table table = gameManager.getTable(room);
        List playerList = table.getPlayers();
        List playerList2 = new ArrayList();
        for (int i = 0; i < playerList.size(); i++) {
            Player player = (Player) playerList.get(i);
            Map playerMap = new HashMap();
            playerMap.put("pokerChip", player.getCash());
            playerMap.put("player", player.getName());
            Card[] handArr = player.getHand().getCards();
            List handList = new ArrayList();
            for (int j = 0; j < handArr.length; j++) {
                handList.add(handArr[j].toString());
            }
            playerMap.put("handCards", handList);
            playerMap.put("playerId", player.getId());
            playerMap.put("status", player.getAction() == null ? "" : player.getAction().getName());
            playerList2.add(playerMap);
            //
            if (player.getId().equals(rc.getReq().getSession().getAttribute("playerId"))) {
                List actionList = new ArrayList();
                actionList.add("Continue");
                actionList.add("Raise");
                actionList.add("Fold");
                playerMap.put("actions", actionList);
View Full Code Here


        ls.addAll(gameManager.getTableState(room).getPlayers());
    }

    @WebModelHandler(startsWith = "/action/hand")
    public void hand(@WebModel Map m, @WebParam("room") String room, @WebParam("player") String player) {
        Player actionPlayer = gameManager.getPlayer(room, player);
        if (actionPlayer != null) {
            m.put("hand", actionPlayer.getHand());
        }
    }
View Full Code Here

    @WebActionHandler
    public void bet(@WebParam("room") String room, @WebParam("player") String player) {
        //todo need bet value
        Table table = gameManager.getTable(room);
        if (table != null) {
            Player actionPlayer = table.getPlayer(player);
            if (actionPlayer != null) {
                actionPlayer.act(table, Action.BET, -1, -1);
            }
        }
    }
View Full Code Here

    @WebActionHandler
    public void call(@WebParam("room") String room, @WebParam("player") String player) {
        Table table = gameManager.getTable(room);
        if (table != null) {
            Player actionPlayer = table.getPlayer(player);
            if (actionPlayer != null) {
                actionPlayer.act(table, Action.CALL, -1, -1);
            }
        }
    }
View Full Code Here

    @WebActionHandler
    public void fold(@WebParam("room") String room, @WebParam("player") String player) {
        Table table = gameManager.getTable(room);
        if (table != null) {
            Player actionPlayer = table.getPlayer(player);
            if (actionPlayer != null) {
                actionPlayer.act(table, Action.FOLD, -1, -1);
            }
        }
    }
View Full Code Here

    @WebActionHandler
    public void check(@WebParam("room") String room, @WebParam("player") String player) {
        Table table = gameManager.getTable(room);
        if (table != null) {
            Player actionPlayer = table.getPlayer(player);
            if (actionPlayer != null) {
                actionPlayer.act(table, Action.CHECK, -1, -1);
            }
        }
    }
View Full Code Here

    @WebActionHandler
    public void raise(@WebParam("room") String room, @WebParam("player") String player) {
        Table table = gameManager.getTable(room);
        if (table != null) {
            Player actionPlayer = table.getPlayer(player);
            if (actionPlayer != null) {
                actionPlayer.act(table, Action.RAISE, -1, -1);
            }
        }

    }
View Full Code Here

            List playerList = gameManager.getTable("1").getPlayers();
            int index = gameManager.mock_index++;
            if (index>7) {
                index=0;
            }
            Player player = (Player) playerList.get(index);
            rc.getReq().getSession().setAttribute("playerId", player.getId());
            //
        } else {
            rc.getReq().getSession().removeAttribute("user");
        }
    }
View Full Code Here

TOP

Related Classes of com.poker.game.Player

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.