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

void SpiderGame::start (  )  [private]

Start a new game

Definition at line 221 of file game.c.

References SpiderSetup::variation.

Referenced by ProcessKey(), and Show().

{
  // Load bitmaps
  if (cursor == NULL)
  {
    cursor = new Bitmap(cursorWidth, cursorHeight, confdir, cursorName);
    back = new Bitmap(cardWidth, cardHeight, confdir, coverName);
    frame = new Bitmap(cardWidth, cardHeight, clrWhite, clrGray50);

    for (int s = 0; s < suitCount; ++s)
      for (int r = 0; r < rankCount; ++r)
        cards[s][r] = new Bitmap(cardWidth, cardHeight, confdir,
                                 suitNames[s], rankNames[r]);
  }

  delete deck;
  delete tableau;
  deck = NULL;
  tableau = NULL;

  int deckCount, dealCount, pileCount;

  if (setup.variation == SpiderSetup::Mini)
  {
    deckCount = 1;
    dealCount = 4;
    pileCount = 7;
  }
  else // normal variation
  {
    deckCount = 2;
    dealCount = 5;
    pileCount = 10;
    xDist = -23;
  }

  if (pileCount > rankCount * suitCount * deckCount)
    pileCount = rankCount * suitCount * deckCount;
  int finalCount = suitCount * deckCount;
  deck = new Deck(rankCount, suitCount, deckCount);
  tableau = new Tableau(*deck, pileCount, finalCount, dealCount);
}


Generated by  Doxygen 1.6.0   Back to index