Commit 18764134 authored by Yildius's avatar Yildius

Comments and cleaning on player.py

parent a55966a0
......@@ -34,8 +34,7 @@ class Player:
self.__chips = int(0)
self.__cards = []
self.__chipsOnTable = int(0)
self.__position = int(0)
self.__hasHadAction = bool(False)
self.__hasHadAction = False
self.__playerState = PlayerState.PLAYING
self.__name = name
self.__potId = -1
......@@ -170,12 +169,15 @@ class Player:
self.__chips += chips
def yieldBet(self):
# Moves the money that was on the table to the pot
self.__hasHadAction = False
temp = self.__chipsOnTable
self.__chipsOnTable = 0
return temp
def yieldPartialBet(self, value):
## Moves part of the money that was on the table to the pot, used for
# split pots
self.__hasHadAction = False
chips = min(value, self.__chipsOnTable)
self.__chipsOnTable -= chips
......@@ -187,10 +189,8 @@ class Player:
def giveBB(self, bigBlind):
return self.__putMoneyOnTable(bigBlind)
# Actions, called by Table.
# By calling these methods, Table authorises the transaction.
def bet(self, amount):
# amount is the money to be added
# Returns the amount actually added
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment