Note that there are some explanatory texts on larger screens.

plurals
  1. PO(How to manipulate)Poker Positioning using ENUM
    primarykey
    data
    text
    <p>Let's say I created the following class:</p> <pre><code>public enum Position { Dealer(1), //1 SB(2), //2 BB(3), //3 UTG(4), //4 UTG1(5), //5 UTG2(6), //6 UTG3(7), //7 HJ(8), //8 CO(9); //9 //Constructor int code; Position(int code) { this.code = code; } } </code></pre> <p>How do I manipulate ENUM by using the numbers in parenthesis? For example, in my Poker Table class, I initiate new players. Each player passes the parameter Position. So initially, </p> <pre><code>player[1].getPosition() = Dealer player[2].getPosition() = SB player[3].getPosition() = BB etc etc etc </code></pre> <p>After the hand is over, all the positions need to be shifted over by one.<br> So player[1] needs to have the CO(9) position.<br> player[2] needs to have the Dealer(1) position.<br> player[3] needs to have the SB(2) position.<br> etc etc</p> <p>I understand that I can just make a for loop with a variable cycling through the numbers 1 through 9, but how do I access the position based on the integer inside the PositionENUM? </p> <hr> <p>EDIT: I already have the getters and setters.</p> <pre><code> public int getCode() { return code; } public void setCode(int code) { this.code = code; } </code></pre> <p>However the getters and the setters do not provide me with the correctly change the Positions of the players each round.</p> <p>After every betting round, I need to change the Position of each player, so I need to figure out how to shift the ENUM Position of each player after each betting round.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload