Package bluffinmuffin.poker.entities

Examples of bluffinmuffin.poker.entities.TableInfo


            }
           
            @Override
            public void gameBettingRoundStarted()
            {
                final TableInfo table = m_game.getTable();
                final List<PlayerInfo> lst = table.getPlayingPlayers();
                for (int i = 0; i < table.getPlayingPlayers().size(); ++i)
                {
                    huds[lst.get(i).getNoSeat()].setAlive();
                }
                int i = 0;
                for (; i < 5 && m_game.getTable().getCards().get(i).getId() != Card.NO_CARD_ID; ++i)
                {
                    board[i].setCard(m_game.getTable().getCards().get(i));
                }
                for (; i < 5; ++i)
                {
                    board[i].setCard(Card.HIDDEN_CARD);
                }
            }
           
            @Override
            public void gameBlindsNeeded()
            {
                changePotAmount(0);
                final TableInfo table = m_game.getTable();
                huds[table.getNoSeatDealer()].setDealer();
                huds[table.getNoSeatSmallBlind()].setSmallBlind();
                huds[table.getNoSeatBigBlind()].setBigBlind();
                for (int i = 0; i < 5; ++i)
                {
                    board[i].setCard(Card.HIDDEN_CARD);
                }
            }
           
            @Override
            public void gameEnded()
            {
                final TableInfo table = m_game.getTable();
                for (int i = 0; i < table.getPlayers().size(); ++i)
                {
                    if (table.getPlayer(i) != null)
                    {
                        final JPanelPlayerHud php = huds[i];
                        final JLabel bet = bets[i];
                        bet.setText("");
                        php.setPlayerMoney(table.getPlayer(i).getMoneySafeAmnt());
                        php.setNotDealer();
                        php.setNoBlind();
                        php.isDoingNothing();
                        if (table.getPlayer(i).getMoneySafeAmnt() == 0)
                        {
                            php.setDead();
                            php.setPlayerCards(Card.NO_CARD, Card.NO_CARD);
                        }
                        php.setPlayerAction(PlayerActionType.NOTHING);
                    }
                }
                super.gameEnded();
            }
           
            @Override
            public void gameGenerallyUpdated()
            {
                final TableInfo table = m_game.getTable();
                for (final PlayerInfo p : table.getPlayers())
                {
                    final JPanelPlayerHud php = huds[p.getNoSeat()];
                    installPlayer(php, p);
                }
            }
           
            @Override
            public void playerActionNeeded(PlayerInfo p, PlayerInfo last)
            {
                final JPanelPlayerHud php = huds[p.getNoSeat()];
                php.setPlayerAction(PlayerActionType.NOTHING, 0);
                php.isPlaying();
            }
           
            @Override
            public void playerActionTaken(PlayerInfo p, PlayerActionType reason, int playedAmount)
            {
                final TableInfo table = m_game.getTable();
                final JPanelPlayerHud php = huds[p.getNoSeat()];
                php.setPlayerMoney(p.getMoneySafeAmnt());
                php.isDoingNothing();
                php.setPlayerAction(reason, playedAmount);
                changePotAmount(table.getTotalPotAmnt());
               
                if (reason == PlayerActionType.FOLDED)
                {
                    php.setPlayerCards(Card.NO_CARD, Card.NO_CARD);
                }
View Full Code Here


            }
           
            @Override
            public void gameBettingRoundStarted()
            {
                final TableInfo table = m_game.getTable();
                final GameRoundType r = table.getRound();
                writeLine("==> Beginning of " + r.name());
                if (r != GameRoundType.PREFLOP)
                {
                    write("==> Current board cards:");
                    for (int i = 0; i < 5 && table.getCards().get(i).getId() != Card.NO_CARD_ID; ++i)
                    {
                        write(" " + table.getCards().get(i).toString());
                    }
                    writeLine("");
                }
            }
           
            @Override
            public void gameBlindsNeeded()
            {
                writeLine("==> Game started");
                final TableInfo table = m_game.getTable();
                final PlayerInfo d = table.getPlayer(table.getNoSeatDealer());
                final PlayerInfo sb = table.getPlayer(table.getNoSeatSmallBlind());
                final PlayerInfo bb = table.getPlayer(table.getNoSeatBigBlind());
                writeLine("==> " + d.getName() + " is the Dealer");
                writeLine("==> " + sb.getName() + " is the SmallBlind");
                writeLine("==> " + bb.getName() + " is the BigBlind");
            }
           
View Full Code Here

            jFoldButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    disableButtons();
                    final TableInfo table = m_game.getTable();
                    final PlayerInfo p = table.getPlayer(m_currentTablePosition);
                    m_game.playMoney(p, -1);
                }
            });
        }
        return jFoldButton;
View Full Code Here

            jCallButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    disableButtons();
                    final TableInfo table = m_game.getTable();
                    final PlayerInfo p = table.getPlayer(m_currentTablePosition);
                    m_game.playMoney(p, table.getCallAmnt(p));
                }
            });
        }
        return jCallButton;
    }
View Full Code Here

            jRaiseButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    disableButtons();
                    final TableInfo table = m_game.getTable();
                    final PlayerInfo p = table.getPlayer(m_currentTablePosition);
                    m_game.playMoney(p, (Integer) getJRaiseSpinner().getValue() - p.getMoneyBetAmnt());
                }
            });
        }
        return jRaiseButton;
View Full Code Here

                if (p.getNoSeat() == m_currentTablePosition)
                {
                    getJFoldButton().setEnabled(true);
                    setCallButtonName();
                    getJCallButton().setEnabled(true);
                    final TableInfo table = m_game.getTable();
                    if (table.getHigherBet() < p.getMoneyAmnt())
                    {
                        final int min = table.getMinRaiseAmnt(p) + p.getMoneyBetAmnt();
                        getJRaiseButton().setEnabled(true);
                        getJRaiseSpinner().setEnabled(true);
                        getJRaiseSpinner().setModel(new SpinnerNumberModel(min, min, p.getMoneyAmnt(), min));
                    }
                }
View Full Code Here

        });
    }
   
    public void setCallButtonName()
    {
        final TableInfo table = m_game.getTable();
        final PlayerInfo p = table.getPlayer(m_currentTablePosition);
        String s;
        if (table.canCheck(p))
        {
            s = "CHECK";
        }
        else if (table.getHigherBet() >= p.getMoneyAmnt())
        {
            s = "ALL-IN";
        }
        else
        {
View Full Code Here

                }
                else
                {
                    client = new GameTCPServer(game, DataManager.Persistance.get(command.getPlayerName()));
                }
                final TableInfo table = game.getTable();
                if (!game.isRunning())
                {
                    sendMessage(command.encodeErrorResponse());
                    return;
                }
               
                // Verify the player does not already playing on that table.
                if (!table.containsPlayer(command.getPlayerName()))
                {
                    final boolean ok = client.joinGame();
                    if (!ok)
                    {
                        sendMessage(command.encodeErrorResponse());
View Full Code Here

            final PokerGame game = m_games.get(noPort);
           
            // Check if the table is still running.
            if (game.isRunning())
            {
                final TableInfo table = game.getTable();
                if (table.getClass().equals(TableInfoCareer.class))
                {
                    tables.add(new TupleTableInfoCareer(noPort, table.getName(), table.getBigBlindAmnt(), table.getPlayers().size(), table.getNbMaxSeats(), table.getBetLimit(), PossibleActionType.None));
                }
            }
            else
            {
                tablesToRemove.add(noPort);
View Full Code Here

            final PokerGame game = m_games.get(noPort);
           
            // Check if the table is still running.
            if (game.isRunning())
            {
                final TableInfo table = game.getTable();
                if (table.getClass().equals(TableInfoTraining.class))
                {
                    tables.add(new TupleTableInfoTraining(noPort, table.getName(), table.getBigBlindAmnt(), table.getPlayers().size(), table.getNbMaxSeats(), table.getBetLimit(), PossibleActionType.None));
                }
            }
            else
            {
                tablesToRemove.add(noPort);
View Full Code Here

TOP

Related Classes of bluffinmuffin.poker.entities.TableInfo

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.