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

void Tableau::move ( int  p  ) 

Move cards from selected pile to p-th pile

Definition at line 157 of file tableau.c.

References Pile::adaptSelectionTo(), History::add(), Heap::count(), History::current(), Move::execute(), Pile::open(), Pile::selected(), and unselect().

Referenced by autoMove(), autoMoveLeft(), and autoMoveRight().

{
  selected->adaptSelectionTo(piles[p]);
  int count = selected->selected();
  if (count > 0)
  {
    bool turn = (count == selected->open() && count < selected->count());
    history->add(new NormalMove(selected, piles[p], count, turn));
    history->current()->execute();
  }
  unselect();
  changed = true;
}


Generated by  Doxygen 1.6.0   Back to index