Simple Poker Template 0.0.1
Loading...
Searching...
No Matches
SimplePoker.Logic.PlayerBase Class Reference

Base class representing a player in the poker game, handling actions, bets, and interactions with the game environment. More...

Inheritance diagram for SimplePoker.Logic.PlayerBase:
SimplePoker.Logic.Cpu SimplePoker.Logic.Human

Public Member Functions

virtual void Awake ()
 Initializes the player's setup and subscribes to relevant game events.
 
void ClearHand ()
 Clears the player's hand, removing the cards.
 
void AddCardToHand (Card newCard)
 Adds a card to the player's hand and invokes corresponding events.
 
void UpdatePokerHand (List< Card > cardsInTable)
 Updates the player's poker hand based on the cards on the table and invokes the corresponding event.
 
void SetChips (int chips)
 Sets the player's chip count.
 
void AddChips (int chips)
 Adds chips to the player's chip count.
 
void SetDealer ()
 Sets the player as the dealer.
 
void SetSmallBlind (int chips)
 Sets the player as the small blind and makes a initial bet.
 
void SetBigBlind (int chips)
 Sets the player as the big blind and makes a initial bet.
 
virtual void ResetSetup ()
 Resets the player's setup by clearing their hand and resetting the current bet to zero.
 
void ResetActions ()
 Resets all player actions to their default state.
 
void DoFold ()
 Player executes the fold action.
 
void DoCheckOrCall ()
 Player executes the check or call action.
 
void DoCheck ()
 Player executes the check action.
 
void DoCall ()
 Player execute the call action.
 
void DoRaise ()
 Executes the raise action for the player with a default raise amount.
 
void DoRaise (int raiseChips)
 Executes the raise action for the player with a specified raise amount.
 
void DoAllIn ()
 Player executes the all-in action.
 
bool DidAnAction ()
 Checks if the player has performed any action.
 
virtual void Setup (int positionIndex)
 Initializes the player's position index in the game.
 
virtual void DoTurn (GameManager.TurnPoker turn)
 Initiates the player's turn in the game, handling scenarios where the player is required to perform specific actions.
 

Public Attributes

Action< PokerActionOnActionChoosed
 
Action< Card, List< Card > > OnCardAddedToHand
 
Action< PokerHandOnHandUpdated
 
Action< int, int > OnChipsAmountChanged
 
Action OnWinnerChoosen
 
Action< int > OnBetMaked
 
Action< PokerChipOnPokerChipSeted
 
Action OnPlayerActived
 
string Name
 

Protected Member Functions

IEnumerator CallNextPlayerCoroutine (float duration)
 Coroutine to delay the next player's turn.
 

Protected Attributes

bool IsMyTurn
 
PokerGameAssetData asset
 
GameManager gameManager
 

Properties

int PositionIndex [get]
 
bool IsPlayer [get]
 
List< CardCards [get]
 
PokerHand PokerHand [get]
 
PokerChip PokerChip [get]
 
int Chips [get]
 
int CurrentBet [get]
 
bool IsCheck [get]
 
bool IsCall [get]
 
bool IsRaise [get]
 
bool IsAllIn [get]
 
bool IsFold [get]
 
bool ContinueAllInNextTurn [get, set]
 
bool ContinueFoldNextTurn [get]
 
PokerAction PokerAction [get]
 

Detailed Description

Base class representing a player in the poker game, handling actions, bets, and interactions with the game environment.

Member Function Documentation

◆ AddCardToHand()

void SimplePoker.Logic.PlayerBase.AddCardToHand ( Card newCard)

Adds a card to the player's hand and invokes corresponding events.

◆ AddChips()

void SimplePoker.Logic.PlayerBase.AddChips ( int chips)

Adds chips to the player's chip count.

◆ Awake()

virtual void SimplePoker.Logic.PlayerBase.Awake ( )
virtual

Initializes the player's setup and subscribes to relevant game events.

Reimplemented in SimplePoker.Logic.Human.

◆ CallNextPlayerCoroutine()

IEnumerator SimplePoker.Logic.PlayerBase.CallNextPlayerCoroutine ( float duration)
protected

Coroutine to delay the next player's turn.

Parameters
durationThe duration to wait before advancing to the next player.

◆ ClearHand()

void SimplePoker.Logic.PlayerBase.ClearHand ( )

Clears the player's hand, removing the cards.

◆ DidAnAction()

bool SimplePoker.Logic.PlayerBase.DidAnAction ( )

Checks if the player has performed any action.

Returns
True if the player has performed an action, otherwise false.

◆ DoAllIn()

void SimplePoker.Logic.PlayerBase.DoAllIn ( )

Player executes the all-in action.

◆ DoCall()

void SimplePoker.Logic.PlayerBase.DoCall ( )

Player execute the call action.

◆ DoCheck()

void SimplePoker.Logic.PlayerBase.DoCheck ( )

Player executes the check action.

◆ DoCheckOrCall()

void SimplePoker.Logic.PlayerBase.DoCheckOrCall ( )

Player executes the check or call action.

◆ DoFold()

void SimplePoker.Logic.PlayerBase.DoFold ( )

Player executes the fold action.

◆ DoRaise() [1/2]

void SimplePoker.Logic.PlayerBase.DoRaise ( )

Executes the raise action for the player with a default raise amount.

◆ DoRaise() [2/2]

void SimplePoker.Logic.PlayerBase.DoRaise ( int raiseChips)

Executes the raise action for the player with a specified raise amount.

◆ DoTurn()

virtual void SimplePoker.Logic.PlayerBase.DoTurn ( GameManager::TurnPoker turn)
virtual

Initiates the player's turn in the game, handling scenarios where the player is required to perform specific actions.

Parameters
turnThe current turn in the game.

Reimplemented in SimplePoker.Logic.Cpu, and SimplePoker.Logic.Human.

◆ ResetActions()

void SimplePoker.Logic.PlayerBase.ResetActions ( )

Resets all player actions to their default state.

◆ ResetSetup()

virtual void SimplePoker.Logic.PlayerBase.ResetSetup ( )
virtual

Resets the player's setup by clearing their hand and resetting the current bet to zero.

◆ SetBigBlind()

void SimplePoker.Logic.PlayerBase.SetBigBlind ( int chips)

Sets the player as the big blind and makes a initial bet.

◆ SetChips()

void SimplePoker.Logic.PlayerBase.SetChips ( int chips)

Sets the player's chip count.

◆ SetDealer()

void SimplePoker.Logic.PlayerBase.SetDealer ( )

Sets the player as the dealer.

◆ SetSmallBlind()

void SimplePoker.Logic.PlayerBase.SetSmallBlind ( int chips)

Sets the player as the small blind and makes a initial bet.

◆ Setup()

virtual void SimplePoker.Logic.PlayerBase.Setup ( int positionIndex)
virtual

Initializes the player's position index in the game.

Parameters
positionIndexThe position index of the player to enable on the table.

◆ UpdatePokerHand()

void SimplePoker.Logic.PlayerBase.UpdatePokerHand ( List< Card > cardsInTable)

Updates the player's poker hand based on the cards on the table and invokes the corresponding event.

Parameters
cardsInTableThe cards currently on the table.

Member Data Documentation

◆ asset

PokerGameAssetData SimplePoker.Logic.PlayerBase.asset
protected

◆ gameManager

GameManager SimplePoker.Logic.PlayerBase.gameManager
protected

◆ IsMyTurn

bool SimplePoker.Logic.PlayerBase.IsMyTurn
protected

◆ Name

string SimplePoker.Logic.PlayerBase.Name

◆ OnActionChoosed

Action<PokerAction> SimplePoker.Logic.PlayerBase.OnActionChoosed

◆ OnBetMaked

Action<int> SimplePoker.Logic.PlayerBase.OnBetMaked

◆ OnCardAddedToHand

Action<Card, List<Card> > SimplePoker.Logic.PlayerBase.OnCardAddedToHand

◆ OnChipsAmountChanged

Action<int, int> SimplePoker.Logic.PlayerBase.OnChipsAmountChanged

◆ OnHandUpdated

Action<PokerHand> SimplePoker.Logic.PlayerBase.OnHandUpdated

◆ OnPlayerActived

Action SimplePoker.Logic.PlayerBase.OnPlayerActived

◆ OnPokerChipSeted

Action<PokerChip> SimplePoker.Logic.PlayerBase.OnPokerChipSeted

◆ OnWinnerChoosen

Action SimplePoker.Logic.PlayerBase.OnWinnerChoosen

Property Documentation

◆ Cards

List<Card> SimplePoker.Logic.PlayerBase.Cards
get

◆ Chips

int SimplePoker.Logic.PlayerBase.Chips
get

◆ ContinueAllInNextTurn

bool SimplePoker.Logic.PlayerBase.ContinueAllInNextTurn
getset

◆ ContinueFoldNextTurn

bool SimplePoker.Logic.PlayerBase.ContinueFoldNextTurn
get

◆ CurrentBet

int SimplePoker.Logic.PlayerBase.CurrentBet
get

◆ IsAllIn

bool SimplePoker.Logic.PlayerBase.IsAllIn
get

◆ IsCall

bool SimplePoker.Logic.PlayerBase.IsCall
get

◆ IsCheck

bool SimplePoker.Logic.PlayerBase.IsCheck
get

◆ IsFold

bool SimplePoker.Logic.PlayerBase.IsFold
get

◆ IsPlayer

bool SimplePoker.Logic.PlayerBase.IsPlayer
get

◆ IsRaise

bool SimplePoker.Logic.PlayerBase.IsRaise
get

◆ PokerAction

PokerAction SimplePoker.Logic.PlayerBase.PokerAction
get

◆ PokerChip

PokerChip SimplePoker.Logic.PlayerBase.PokerChip
get

◆ PokerHand

PokerHand SimplePoker.Logic.PlayerBase.PokerHand
get

◆ PositionIndex

int SimplePoker.Logic.PlayerBase.PositionIndex
get

The documentation for this class was generated from the following file: