Tabel Poker: Mengatur dan Mengelola Turnamen

Tabel Poker: Mengatur dan Mengelola Turnamen

Dalam artikel ini, kita akan membahas tentang tabel poker yang digunakan untuk mengatur dan mengelola turnamen. Tabel ini berisi informasi tentang player, pot, dealer, serta metode-metode yang dapat digunakan untuk memainkan game.

Properti Tabel

  • pots: { amount: number, eligiblePlayers: Player[] }[] – Array of all pots except for the currently active pot. If there are no side pots then this returns undefined.
  • smallBlind: number = 5 – Amount of the small blind bet for the table. Default is 10.
  • smallBlindPlayer?: Player – If there is a small blind position then this will return the player in that position. Otherwise this returns undefined.
  • smallBlindPosition?: number – If there is an active hand then this property will return the position of the small blind. Otherwise this will return undefined.
  • winners?: Player[] – If winners have been determined then then this property will store them. Usually there is only one winner but there can be split pots, in which case this will contain all of the winners in a draw. If there are no winners then this will return undefined.

Metode Tabel

  • cleanUp(): void – Resets the table. Good for manually clearing out the winner state after a hand if you need to render the clean table before starting the next hand.
  • dealCards(): void – This method begins the hand. Assigns players their hole cards and starts the first round of betting.
  • moveDealer(seatNumber: number): void – This method is mostly used internally but it can also be used externally to force the dealer and subsequent blinds into a new position. By default the dealCards method calls this when starting new hands to automatically increment the dealer position. If for some reason you want to manually increment the dealer position between hands then set autoMoveDealer to false.
  • sitDown(id: string, buyIn: number, seatNumber?: number): number – This method allows you to seat a new player at the table. If there is an active hand then they are automatically marked as folded: true so that the action will skip them until a new hand is started. This method returns the seat index the player was placed at. You can optionally specify the seat index to put the player into (0 – 9). An error will throw if a player is already in the specified seat.
  • standUp(player: Player | string): void – This method allows you to remove a player from the table. It accepts a Player object or an ID string. If there is an active hand then the player is marked to leave but not actually removed. When a new hand is dealt any players marked to leave will be removed.

Properti Player

  • bet: number = 0 – This property stores the amount of the individual player's current bet. By default this is zero until they make a bet.
  • folded: boolean = false – This property stores whether or not the player has folded. By default this is false.
  • hand: { name: string, descr: string } – This property returns the user's current hand. name is a string representing the type of hand such as "Flush" or "Two Pair". descr is a string that contains the type of hand and the cards that make up that hand.
  • holeCards?: [Card, Card] – If there is an active hand this property will return a two-element array containing the player's hole cards they have been dealt. Otherwise this will return undefined.
  • id: string – A unique ID for the player. This is passed into the table.sitDown method when adding a player to the table and it allows you to uniquely identify the player in your own code.
  • left: boolean = false – This property is true if the player has "stood up" from the table but there is an active hand. Players marked with left: true will be removed from the table when the hand is over. This way they are still present while the hand they were part of plays out.
  • raise?: number – This property stores the amount of the player's last raise. If they have not made a raise then this property is undefined.
  • showCards: boolean = false – This property can be used to determine if the player's hole cards should be shown. This is marked true if the player is still in play during showdown where winners are determined.
  • stackSize: number – This property stores the amount of money the player has left. The initial value is passed in as the second argument when you call table.sitDown.
  • table: Table – This property is simply a convenience reference back to the table the player is part of.

Dalam artikel ini, kita telah melihat bagaimana tabel poker digunakan untuk mengatur dan mengelola turnamen. Dengan memahami properti-properti dan metode-metode yang tersedia, Anda dapat lebih mudah dalam mengatur dan memainkan game poker.