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

int Tableau::autoMoveLeft ( int  p  ) 

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

Definition at line 172 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 >= 0; --i)
      if (piles[i]->empty() || selected->selectionMatchesTo(piles[i]))
        break;
    if (i >= 0)
      move(i);
    changed = true;
  }
  return i;
}


Generated by  Doxygen 1.6.0   Back to index