Logo Search packages:      
Sourcecode: vdr-plugin-spider version File versions

void Pile::select ( int  max = 0  ) 

Select up to max matching cards on the end of this pile

Definition at line 214 of file heap.c.

References Heap::card(), Heap::count(), Card::matchesTo(), and open().

Referenced by SpiderGame::ProcessKey(), and Tableau::select().

{
  currentSelected = 0;
  if (open() > 0)
  {
    currentSelected = 1;
    for (int i = count(); --i > count() - open(); )
      if (card(i).matchesTo(card(i - 1)))
        currentSelected++;
      else
        break;
  }
  if (currentSelected > max && max > 0)
    currentSelected = max;
  if (currentChanged < currentSelected)
    currentChanged = currentSelected;
}


Generated by  Doxygen 1.6.0   Back to index