public class HandUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int |
getHighestScorePossible(GameState state,
CardColour colour)
Calculates the maximum possible score obtainable for the given colour
|
static int |
getMinTableValue(GameState state) |
static Integer[] |
getTableScores(GameState state) |
static int |
hasUnidentifiedCard(Hand hand,
int value)
Will return the index of a card that matches the rule
|
static boolean |
isSafeBecauseFiveAlreadyPlayed(GameState state,
CardColour c) |
static boolean |
isSafeBecauseValueLowerThanMinOnTable(GameState state,
Integer value) |
static boolean |
isSafeBecauseValueLowerThanPlayed(GameState state,
CardColour c,
Integer value) |
static boolean |
isSafeToDiscard(GameState state,
CardColour c,
Integer value) |
static boolean |
isSafeToDiscard(GameState state,
int player,
int slot)
Returns true if a given card is safe to discard.
|
static boolean |
isSafeToDiscardHigherThanPossible(GameState state,
CardColour colour,
Integer value)
Returns true if the card is safe to discard because it is higher than what is currently possible for its colour
|
static boolean |
knowsItIsSafeToDiscard(GameState state,
int player,
int slot)
Returns true if a given card is safe to discard.
|
public static int getHighestScorePossible(GameState state, CardColour colour)
state
- The game statecolour
- The colour to look atpublic static boolean isSafeToDiscardHigherThanPossible(GameState state, CardColour colour, Integer value)
I.e if all the Blue 2's have been discarded and none played, then any Blue 3, 4 or 5 is safe to discard
state
- The game statecolour
- The colour of the card to considervalue
- The value of the card to considerpublic static boolean isSafeToDiscard(GameState state, int player, int slot)
state
- The game stateplayer
- The playerslot
- The slotpublic static boolean isSafeToDiscard(GameState state, CardColour c, Integer value)
public static boolean isSafeBecauseFiveAlreadyPlayed(GameState state, CardColour c)
public static boolean isSafeBecauseValueLowerThanPlayed(GameState state, CardColour c, Integer value)
public static boolean isSafeBecauseValueLowerThanMinOnTable(GameState state, Integer value)
public static int hasUnidentifiedCard(Hand hand, int value)
value
- The value we are looking forpublic static boolean knowsItIsSafeToDiscard(GameState state, int player, int slot)
state
- The game stateplayer
- The playerslot
- The slotpublic static int getMinTableValue(GameState state)
Copyright © 2017 FOSS Galaxy. All rights reserved.