Examples of PokerChips


Examples of com.barrybecker4.game.multiplayer.poker.ui.chips.PokerChips

    /**
     * this draws the players chips at the specified location.
     */
    public void render( Graphics2D g2, Location location, int amount, int cellSize) {

        final PokerChips chips = new PokerChips(amount);

        GameContext.log(3, "chips stacks = " + chips);

        int x;
        int width;
        int height = 0;
        int y = cellSize * location.getRow();

        for (PokerChip chipType : chips.keySet()) {

            int numChips = chips.get(chipType);
            height = (int)(cellSize * numChips * CHIP_HEIGHT);
            width = (int)(CHIP_PILE_WIDTH * cellSize);
            g2.setColor(chipType.getColor());
            x = (int)((chipType.ordinal() * CHIP_PILE_WIDTH + location.getCol() + 1) * cellSize);
            y = location.getRow() * cellSize - height;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.