Add: Game UI Taskbar tests #314
+13
-13
@@ -412,7 +412,7 @@ public class TaskbarController {
|
|||||||
boolean phaseChanged) {
|
boolean phaseChanged) {
|
||||||
|
|
||||||
// boolean firstPlayerNewRound =
|
// boolean firstPlayerNewRound =
|
||||||
// phaseChanged && isFirstPreflopPlayerInputOnly(state, me);
|
// phaseChanged && isFirstPreflopPlayer(state, me);
|
||||||
inputActionAllowed = false;
|
inputActionAllowed = false;
|
||||||
if (!isMyTurn || isOutOrFinished || state == null || me == null) {
|
if (!isMyTurn || isOutOrFinished || state == null || me == null) {
|
||||||
setBetButtonVisible(false);
|
setBetButtonVisible(false);
|
||||||
@@ -433,20 +433,20 @@ public class TaskbarController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (isFirstPreflopPlayerInputOnly(state, me)) {
|
if (isFirstPreflopPlayer(state, me)) {
|
||||||
// setActionEnabled(betButton, true);
|
setActionEnabled(betButton, true);
|
||||||
// setActionEnabled(callButton, false);
|
setActionEnabled(callButton, false);
|
||||||
// setActionEnabled(foldButton, false);
|
setActionEnabled(foldButton, false);
|
||||||
// setActionEnabled(raiseButton, false);
|
setActionEnabled(raiseButton, false);
|
||||||
// activateInputField(taskbarInput);
|
activateInputField(taskbarInput);
|
||||||
// inputActionAllowed = true;
|
inputActionAllowed = true;
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (isFirstPlayerOfPhase(state, me)) {
|
if (isFirstPlayerOfPhase(state, me)) {
|
||||||
setActionEnabled(betButton, true);
|
setActionEnabled(betButton, true);
|
||||||
setActionEnabled(callButton, false);
|
setActionEnabled(callButton, false);
|
||||||
setActionEnabled(foldButton, false);
|
// setActionEnabled(foldButton, false);
|
||||||
setActionEnabled(raiseButton, false);
|
setActionEnabled(raiseButton, false);
|
||||||
activateInputField(taskbarInput);
|
activateInputField(taskbarInput);
|
||||||
inputActionAllowed = true;
|
inputActionAllowed = true;
|
||||||
@@ -605,7 +605,7 @@ public class TaskbarController {
|
|||||||
* @return A boolean value indicating whether the current player is the first to act in the
|
* @return A boolean value indicating whether the current player is the first to act in the
|
||||||
* pre-flop phase with only the initial blind layout in place.
|
* pre-flop phase with only the initial blind layout in place.
|
||||||
*/
|
*/
|
||||||
private boolean isFirstPreflopPlayerInputOnly(GameState state, Player me) {
|
private boolean isFirstPreflopPlayer(GameState state, Player me) {
|
||||||
if (state == null || me == null || !isPreflop(state.phase) || state.players == null) {
|
if (state == null || me == null || !isPreflop(state.phase) || state.players == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1078,7 +1078,7 @@ public class TaskbarController {
|
|||||||
return ValidationResult.blocked("Bet must match at least the call amount");
|
return ValidationResult.blocked("Bet must match at least the call amount");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFirstPlayerOfPhase(state, me)) {
|
if (isFirstPreflopPlayer(state, me)) {
|
||||||
if (required > FIRST_PLAYER_MAX_BET) {
|
if (required > FIRST_PLAYER_MAX_BET) {
|
||||||
return ValidationResult.blocked(
|
return ValidationResult.blocked(
|
||||||
"First player cannot bet more than " + FIRST_PLAYER_MAX_BET);
|
"First player cannot bet more than " + FIRST_PLAYER_MAX_BET);
|
||||||
|
|||||||
Reference in New Issue
Block a user