Ejemplo n.º 1
0
// Return sum of chips in this and pots in
// list after this pot.
CChips Cpot::getTotalChips() const
{
  if (getNext())
    return getChips() + getNext()->getTotalChips();
  else
    return getChips();
}
Ejemplo n.º 2
0
void Cpot::print()
{  
#ifdef DEBUG_POT_

  std::cout << "Chips=" << getChips()
            << " Stake=" << getStake()
            << " Bet=" << getBet() << endl;

  cout << "   chips ---> [";
  for (int i = 0; i < 9; i++)
  {
    cout << chips_[i] << ' ';
  }
  cout << chips_[9] << ']' << endl;

#endif
};  
Ejemplo n.º 3
0
void Cpot::subtractChips(const CChips& c)
{ // This function subtracts chips from the pot evenly across all players
  int i = 0;
  CChips numChips = getChips();
  CChips chips(c);
  CChips oneChip(1, 0);

  while (chips > 0 && numChips >= chips)
  {
    for (i = 0; (chips > 0) && (i < 10); i++)
    {
      if (chips_[i] > 0)
      {
        chips_[i] -= oneChip;
        chips -= oneChip;
      }
    }
  }    
}
Ejemplo n.º 4
0
//{
//##############################################################
//#                         GLOBALS                            #
//##############################################################
global turn = 0;
global myChips = getChips();
global mychipsCd = [];
global CAT_ATK = "atk";
global CAT_DEF = "def";
global CAT_BUF = "buf";
global CAT_VIE = "vie";
global CAT_DEBUF = "debuf";

//}
//{
//##############################################################
//#                         DATA TYPE                          #
//##############################################################
/**
 * renvoie l'élément qui a pour clé key
 **/
function getItem(key, dict) {
	for (var item in dict) {
		if (inArray(item, key)) {
			return item[1];
		}
	}
	return null;
}

/**