|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--au.com.solidsoftware.multimahjong.mmc.game.PayoutInfo
The PayoutInfo class acts as an interpreter between the
Payout object and the PayoutGUI object. It
generates all the required text for the PayoutGUI object so that
it can then display this to the user.
Payout,
PayoutGUI,
Game| Field Summary | |
private static int |
ALL_KONG
Represents a unique value for an All Kong (Nine Gates) Special Hand |
private static int |
ALL_WINDS_AND_DRAGS
Represents a unique value for an All Winds and Dragons Special Hand |
(package private) int[] |
consecutiveChows
Used to reflect whether or not the hand contained consecutive sets of Chows. |
(package private) boolean[] |
doubleFlags
Holds flags required for displaying scoring information required for an Ordinary Suit Hand. |
(package private) int[] |
doubleInfo
Holds further information required to generate the scoring information of an Ordinary Suit Hand. |
private static int |
FOUR_BIG_WINDS
Represents a unique value for a Four Big Winds Special Hand |
private static int |
FOUR_LITTLE_WINDS
Represents a unique value for a Four Little Winds Special Hand |
(package private) boolean[] |
gameDoubleFlags
Holds additional flags required for scoring information of an Ordinary Suit Hand. |
(package private) int[] |
groundInfo
Holds information pertaining to the ground score information for an Ordinary Suit Hand. |
(package private) int |
handLimit
The maximum score for any given hand. |
private static int |
HEADS_AND_TAILS
Represents a unique value for a Heads and Tails Special Hand |
private static int |
IMPERIAL_JADE
Represents a unique value for an Imperial Jade Special Hand |
(package private) int |
lastPickup
Indicates where in the game the winning player picked up their last tile from. |
static int |
MAX_DOUBLES_SIZE
Indicates the maximum number of items which can be displayed concerning the doubles of an Ordinary Suit Hand. |
static int |
MAX_GROUND_SCORE_SIZE
Indicates the maximum number of items which can be displayed concerning the ground score of an Ordinary Suit Hand. |
private static int |
MIXED_PUNG
Represents a unique value for a Mixed Pung Special Hand |
(package private) PayoutGUI |
payoutPanel
Creates an instance of the PayoutGUI object. |
(package private) int |
score
Holds the total score of the winning player's hand |
(package private) int |
specialHand
Indicates the type of Special Hand that the player has won with, or is set to NONE to indicate that the player has won with an
Ordinary Suit Hand. |
private static int |
THREE_GREAT_SCHOLARS
Represents a unique value for a Three Great Scholars Hand |
| Constructor Summary | |
PayoutInfo()
|
|
| Method Summary | |
void |
adjustInfo(int[] payoutInfo,
java.lang.String[] playerNames,
int[] playerWinds,
int winnersPos,
int totalScore,
int specHand,
int lastPick,
int[] grdInf,
boolean[] doubFlags,
boolean[] gameDoubFlags,
int[] doubInfo,
int[] consChows,
int limit,
int theTotalPayout)
Gathers all info required to generate what's to be shown by the PayoutGUI object. |
private void |
printPayout(int[] payoutInfo,
java.lang.String[] playerNames,
int[] playerWinds,
int winnersPos,
int theTotalPayout)
Provides the PayoutGUI object with all information it
requires concerning the payout which has been made to the winner. |
void |
printScore(Game gameReference,
Set[] concealedSets,
Set[] exposedSets)
Sets up all information that is required to be displayed in the Payout Window. |
void |
printSpecialScore(Game gameReference,
Tile[] concealedHand,
Set[] exposedSets)
Sets up all information that is required to be displayed in the Payout Window. |
private void |
setupDoublesInfo()
Sets up a 2D array of Strings which shows all doubles have been earnt for the winner's hand. |
private void |
setupGroundScoreInfo()
Sets up a 2D String array that contains the ground score item and score corresponding to this ground score item in order to be displayed in the ground score JTable of the Payout Window. |
private void |
setupSpecialHand()
Gives the PayoutGUI object the kind of special hand which
the winner won with and the description of how it's achieved. |
private java.lang.String |
windIdToString(int windID)
Converts a windID into it's corresponding String for the loser's table. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final int IMPERIAL_JADE
private static final int ALL_KONG
private static final int ALL_WINDS_AND_DRAGS
private static final int HEADS_AND_TAILS
private static final int MIXED_PUNG
private static final int FOUR_BIG_WINDS
private static final int FOUR_LITTLE_WINDS
private static final int THREE_GREAT_SCHOLARS
int score
int specialHand
NONE to indicate that the player has won with an
Ordinary Suit Hand.int lastPickup
Payout Object
to specify these locations.int[] groundInfo
Payout object.boolean[] doubleFlags
boolean[] gameDoubleFlags
int[] doubleInfo
int[] consecutiveChows
int handLimit
PayoutGUI payoutPanel
PayoutGUI object. This is used
to display a break down of the scoring and payout information for the
winning hand.public static final int MAX_GROUND_SCORE_SIZE
public static final int MAX_DOUBLES_SIZE
| Constructor Detail |
public PayoutInfo()
| Method Detail |
public void printSpecialScore(Game gameReference,
Tile[] concealedHand,
Set[] exposedSets)
PayoutGUI in order to
display this data to the user.gameReference - A reference to the Game so that it can't proceed
until the user's clicked "OK" to close the Payout
Window.concealedSets - Lists the concealed sets contained in the winning
player's hand.exposedSets - Lists the exposed sets contained in the winning
player's hand.
public void printScore(Game gameReference,
Set[] concealedSets,
Set[] exposedSets)
PayoutGUI in order to
display this data to the user.gameReference - A reference to the Game so that it can't proceed
until the user's clicked "OK" to close the Payout
Window.concealedSets - Lists the concealed sets contained in the winning
player's hand.exposedSets - Lists the exposed sets contained in the winning
player's hand.private void setupGroundScoreInfo()
private void setupDoublesInfo()
private void setupSpecialHand()
PayoutGUI object the kind of special hand which
the winner won with and the description of how it's achieved.
private void printPayout(int[] payoutInfo,
java.lang.String[] playerNames,
int[] playerWinds,
int winnersPos,
int theTotalPayout)
PayoutGUI object with all information it
requires concerning the payout which has been made to the winner.payoutInfo - An array of the payouts.playerNames - An array of the player's names.playerWinds - An array of the player's winds.winnersPos - The position of the winner's details in all of the
other parameter arrays of the printPayout method.totalPayout - The total payout made to the winner.private java.lang.String windIdToString(int windID)
windID - A wind ID.
public void adjustInfo(int[] payoutInfo,
java.lang.String[] playerNames,
int[] playerWinds,
int winnersPos,
int totalScore,
int specHand,
int lastPick,
int[] grdInf,
boolean[] doubFlags,
boolean[] gameDoubFlags,
int[] doubInfo,
int[] consChows,
int limit,
int theTotalPayout)
PayoutGUI object.payoutInfo - Details of the payouts by all players.playerNames - The names of all players.playerWinds - The winds of all players.winnersPos - The position of the winner in the
payoutInfo, playerNames and
playerWinds arrays.totalScore - The total score for the winning hand.specHand - The type of special hand.lastPick - Where the last tile was picked up from.grdInf - Information concerning the ground score of an Ordinary
Suit Hand.doubFlags - Flags concerning doubles applicable to the hand, set by
the Payout object.gameDoubleFlags - Further flags concerning doubles, but these are
Game generated flags.doubInfo - Information concerning doubles.consChows - Information concerning consecutive chows.limit - The set limit on any given hand.theTotalPayout - The total payout made to the winner.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||