SirRender00 / texasholdem

A pure python package for Texas Hold 'Em poker
https://github.com/SirRender00/texasholdem/
MIT License
75 stars 19 forks source link

Get the position of a specific player #184

Closed LucasColas closed 1 year ago

LucasColas commented 1 year ago

Hello, Is it possible to get the position of a specific player. I know you can get : -the id of the player who has the button -The id of the player who has the big blind -The id of the player who has the small blind But can we get the id of the other players (UTG, Cut Off, etc.) Thank you.

SirRender00 commented 1 year ago

There are iterators over the players available: https://texasholdem.readthedocs.io/en/stable/game_information.html#players

You could do something like

next(game.active_iter(loc=game.bb_loc))

For the player after the big blind, and so on.

Those position names may wildly vary by play count, so there's less reason to keep track of them with easy attributes (unlike button, small blind and big blind).

LucasColas commented 1 year ago

Ok, I think it's good for me.

Those position names may wildly vary by play count, so there's less reason to keep track of them with easy attributes (unlike button, small blind and big blind).

Indeed. I will handle that. Thank you.