Package javatro.core
Record Class PokerHand
java.lang.Object
java.lang.Record
javatro.core.PokerHand
- Record Components:
handType- The classification of the poker hand determining base values and increments
Represents the evaluated result of a poker hand with tracking for progression levels and usage
counts. The hand's value is determined by its type, which includes base chips and multipliers
adjusted by level. Play counts are managed externally by
JavatroCore.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of poker hand types with associated base values and progression parameters. -
Constructor Summary
ConstructorsConstructorDescriptionPokerHand(PokerHand.HandType handType) Creates an instance of aPokerHandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetChips()Calculates the total chip value adjusted by the hand's current progression level.Gets the display name of the poker hand type.intCalculates the multiplier value adjusted by the hand's current progression level.intRetrieves the number of times this hand type has been played.handType()Returns the value of thehandTyperecord component.final inthashCode()Returns a hash code value for this object.Increments the play counter for this hand type in the external tracker.toString()Returns a string representation of this record class.
-
Constructor Details
-
PokerHand
Creates an instance of aPokerHandrecord class.- Parameters:
handType- the value for thehandTyperecord component
-
-
Method Details
-
getChips
public int getChips()Calculates the total chip value adjusted by the hand's current progression level. Formula: base_chips + (current_level - 1) * level_increment- Returns:
- Total chips adjusted for current level
-
getMultiplier
public int getMultiplier()Calculates the multiplier value adjusted by the hand's current progression level. Formula: base_multiplier + (current_level - 1) * multiplier_increment- Returns:
- Total multiplier adjusted for current level
-
getHandName
Gets the display name of the poker hand type.- Returns:
- Formal name of the hand type
-
getPlayCount
public int getPlayCount()Retrieves the number of times this hand type has been played.- Returns:
- Current play count from external tracking system
-
incrementPlayed
Increments the play counter for this hand type in the external tracker. Returns the same instance since state is managed externally.- Returns:
- Current instance after updating play count
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
handType
Returns the value of thehandTyperecord component.- Returns:
- the value of the
handTyperecord component
-