File indexing completed on 2025-10-12 04:59:55

0001 // bjgb_shoeutil.h                                                    -*-C++-*-
0002 #ifndef INCLUDED_BJGB_SHOEUTIL
0003 #define INCLUDED_BJGB_SHOEUTIL
0004 
0005 //@PURPOSE: Provide utilities operating on blackjack shoes.
0006 //
0007 //@CLASSES:
0008 //  bjgb::ShoeUtil: namespace for utilities on 'bjgb::Shoe'
0009 //
0010 //@SEE_ALSO: bjgb_shoe
0011 //
0012 //@DESCRIPTION: This component defines a utility 'struct', 'bjgb::ShoeUtil',
0013 // TBD
0014 //
0015 /// Usage
0016 ///-----
0017 // This section illustrates intended use of this component.
0018 //
0019 // TBD
0020 
0021 #include <bjgb_shoe.h>
0022 #include <bjgb_types.h>
0023 
0024 namespace bjgb {
0025 
0026 // ===============
0027 // struct ShoeUtil
0028 // ===============
0029 
0030 struct ShoeUtil {
0031     // This 'struct' provides a namespace for utilities that operate on
0032     // 'bjgb::Shoe' objects.
0033 
0034   public:
0035     // CLASS METHODS
0036     static bool isUnused(const Shoe& shoe);
0037     // Return 'true' if the specified 'shoe' is unused (e.g., since the
0038     // last shuffle), and 'false' otherwise.  Note that this method might
0039     // return false positives since it is possible that a shoe that
0040     // originally contained 8 decks could be used up evenly during the
0041     // course of a game to contain exactly the number of cards in 6 decks.
0042     // TBD this method seems dubious
0043 
0044     static void setTenRichness(Shoe *shoe, int n);
0045     // Set the ten-richness of the specified 'shoe' to the specified 'n'.
0046     // The behavior is undefined unless 'n <= 9'.  The ten-richness of a
0047     // shoe is a measure of the relative abundance ('+n') or scarcity
0048     // ('-n') of ten cards in a shoe as compared to the total number of
0049     // cards and satisfies the proportion '4 / (13 - n)'.
0050 
0051     static Types::Double tenRichness(const Shoe& shoe);
0052     // Return the ten-richness of the specified 'shoe'.  See
0053     // 'setTenRichness' for further information.
0054 };
0055 
0056 // ============================================================================
0057 //                              INLINE DEFINITIONS
0058 // ============================================================================
0059 
0060 // ---------------
0061 // struct ShoeUtil
0062 // ---------------
0063 
0064 } // namespace bjgb
0065 
0066 #endif