Utility class to assure balance between black and white plays. More...
#include <SgUtil.h>
Public Member Functions | |
SgBalancer (int margin) | |
bool | Play (SgBlackWhite color) |
int | Balance () const |
int | Margin () const |
int | NuCalls () const |
int | NuPlayed (SgBlackWhite color) const |
int | NuRejected (SgBlackWhite color) const |
Private Attributes | |
int | m_balance |
int | m_nuCalls |
const int | m_margin |
SgBWArray< int > | m_played |
SgBWArray< int > | m_rejected |
Utility class to assure balance between black and white plays.
The difference between the number of plays by both colors is forced to be within the margin.
Definition at line 50 of file SgUtil.h.
int SgBalancer::Balance | ( | ) | const |
int SgBalancer::Margin | ( | ) | const |
int SgBalancer::NuCalls | ( | ) | const |
int SgBalancer::NuPlayed | ( | SgBlackWhite | color | ) | const |
int SgBalancer::NuRejected | ( | SgBlackWhite | color | ) | const |
bool SgBalancer::Play | ( | SgBlackWhite | color | ) |
int SgBalancer::m_balance [private] |
const int SgBalancer::m_margin [private] |
int SgBalancer::m_nuCalls [private] |
SgBWArray<int> SgBalancer::m_played [private] |
Definition at line 113 of file SgUtil.h.
Referenced by NuPlayed(), and Play().
SgBWArray<int> SgBalancer::m_rejected [private] |
Definition at line 114 of file SgUtil.h.
Referenced by NuRejected(), and Play().