Bug 347

Summary: The re-preparation round goes wrong when there is no player bidding for the landlord
Product: Group 8 (2019) Reporter: ZLQ <leqizheng2-c>
Component: MainAssignee: yanglou3-c
Status: RESOLVED FIXED    
Severity: major CC: jiaqchen5-c, leqizheng2-c, xinlinli7-c, yujiaxu4-c, yuransun2-c
Priority: ---    
Version: Version1.0   
Hardware: PC   
OS: Windows   

Description ZLQ 2019-12-05 13:12:39 HKT
Steps to reproduce:
Start the game and let all players pass when bidding the landlord. You could either try several times as robots bid with the possibility of 50%, or modify the return value of RobotPlayer.call() to false.

Expected Result:
There should be a round of shuffle and deal card deck.

Actual Result:
Cards remain the same in the table.

More information:
The logic in Controller.prepareRound() has some problems, it should create and shuffle a new card deck at the very beginning.
Comment 1 yanglou3-c 2019-12-05 14:39:05 HKT
(In reply to ZLQ from comment #0)
> Steps to reproduce:
> Start the game and let all players pass when bidding the landlord. You could
> either try several times as robots bid with the possibility of 50%, or
> modify the return value of RobotPlayer.call() to false.
> 
> Expected Result:
> There should be a round of shuffle and deal card deck.
> 
> Actual Result:
> Cards remain the same in the table.
> 
> More information:
> The logic in Controller.prepareRound() has some problems, it should create
> and shuffle a new card deck at the very beginning.

We add the function newCardDeck() in the class Table, and discardCard() in the class Player and PlayerHand. 
In preparation round, we modify the flows to create a new card deck in the table, ask all players to discard all their pokers in hand first, and then distribute the cards.
The reported bug has been fixed.