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

int Tableau::autoMoveRight ( int  p  ) 

Search move from p-th pile to the next right pile, return destination

Definition at line 190 of file tableau.c.

References move(), select(), and Pile::selectionMatchesTo().

Referenced by SpiderGame::ProcessKey().

{
  int i = -1;
  if (!piles[p]->empty())
  {
    if (selected != piles[p])
      select(p);
    for (i = p + 1; i < (int)piles.size(); ++i)
      if (piles[i]->empty() || selected->selectionMatchesTo(piles[i]))
        break;
    if (i < (int)piles.size())
      move(i);
    else
      i = -1;
    changed = true;
  }
  return i;
}


Generated by  Doxygen 1.6.0   Back to index