HandValueBase - lcrocker/ojpoker GitHub Wiki
HandValueBase
This is a base class in Dart and a trait in Rust, which doesn't have subclassing. It holds information about the "value" of a hand in poker. The methods that do the actual hand evaluation are static factory methods, so the structure is created by the evaluation, for example:
v = HandValueHigh.referenceEaluator(hand);
Each kind of poker hand (high, low, badugi, etc.) will have its own subclass with these methods:
- referenceEvaluator() Non-optimized evaluator for testing and building tables.
- lookupEvaluator() Optimized evaluator using lookup tables.
- fastValue() Static method that doesn't create a whole value object, just a number for faster simulations.
The information in the structure includes not just the numeric value code for comparison to other hands, but also things like the "level" of hand and the ranks of the cards in evaluation order. For example, the hand "3d7hKc3s3c" will contain the numeric value, a level classifier meaning "trips", and a rank array [ 3, 3, 3, K, 7 ].
Subclasses / Implementations
HandValueHigh · HandValueAceToFive · HandValueDeuceToSeven · HandValueAceToSix · HandValueBadugi · HandValuePaiGow · HandValueActionRazz