ReactOS 0.4.15-dev-8222-g9164419
solgame.cpp File Reference
#include "solitaire.h"
Include dependency graph for solgame.cpp:

Go to the source code of this file.

Macros

#define TRACE(s)
 

Functions

void NewGame (void)
 
bool CARDLIBPROC RowStackDragProc (CardRegion &stackobj, int iNumDragCards)
 
bool CARDLIBPROC RowStackDropProc (CardRegion &stackobj, CardStack &dragcards)
 
bool CanDrop (CardRegion &stackobj, Card card)
 
bool CARDLIBPROC SuitStackDropProc (CardRegion &stackobj, CardStack &dragcards)
 
void CARDLIBPROC SuitStackClickProc (CardRegion &stackobj, int iNumClicked)
 
void CARDLIBPROC RowStackClickProc (CardRegion &stackobj, int iNumClicked)
 
CardRegionFindSuitStackFromCard (Card card)
 
void CARDLIBPROC SuitStackAddProc (CardRegion &stackobj, const CardStack &added)
 
void CARDLIBPROC RowStackDblClickProc (CardRegion &stackobj, int iNumClicked)
 
void CARDLIBPROC PileClickProc (CardRegion &stackobj, int iNumClicked)
 
void CARDLIBPROC PileDblClickProc (CardRegion &stackobj, int iNumClicked)
 
void FixIfOneCardLeft (void)
 
void CARDLIBPROC PileRemoveProc (CardRegion &stackobj, int iItems)
 
void CARDLIBPROC DeckClickProc (CardRegion &stackobj, int iNumClicked)
 

Variables

TCHAR MsgWin [128]
 
TCHAR MsgDeal [128]
 
CardStack activepile
 
int VisiblePileCards
 
int LastId
 
bool fGameStarted = false
 
bool bAutoroute = false
 

Macro Definition Documentation

◆ TRACE

#define TRACE (   s)

Definition at line 4 of file solgame.cpp.

Function Documentation

◆ CanDrop()

bool CanDrop ( CardRegion stackobj,
Card  card 
)

Definition at line 197 of file solgame.cpp.

198{
199 TRACE("ENTER CanDrop()\n");
200 int topval;
201
202 const CardStack &cardstack = stackobj.GetCardStack();
203
204 SetPlayTimer();
205
206 if(cardstack.NumCards() > 0)
207 {
208 if(card.Suit() != cardstack[0].Suit())
209 {
210 TRACE("EXIT CanDrop()\n");
211 return false;
212 }
213
214 topval = cardstack[0].LoVal();
215 }
216 else
217 {
218 topval = 0;
219 }
220
221 //make sure 1 higher
222 if(card.LoVal() != (topval + 1))
223 {
224 TRACE("EXIT CanDrop()\n");
225 return false;
226 }
227
228 TRACE("EXIT CanDrop()\n");
229 return true;
230}
const CardStack & GetCardStack()
Definition: cardregion.cpp:399
int NumCards() const
Definition: cardstack.h:14
int Suit() const
Definition: card.h:54
int LoVal() const
Definition: card.h:59
#define TRACE(s)
Definition: solgame.cpp:4
void SetPlayTimer(void)
Definition: solitaire.cpp:172

Referenced by FindSuitStackFromCard(), and SuitStackDropProc().

◆ DeckClickProc()

void CARDLIBPROC DeckClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 504 of file solgame.cpp.

505{
506 TRACE("ENTER DeckClickProc()\n");
507
508 SetPlayTimer();
509
510 CardStack cardstack = stackobj.GetCardStack();
511 CardStack pile = pPile->GetCardStack();
512
513 fGameStarted = true;
514 SetPlayTimer();
515
516 //reset the face-up pile to represent 3 cards
519
520 if(cardstack.NumCards() == 0)
521 {
522 if (GetScoreMode() == SCORE_VEGAS)
523 {
525 {
526 pile.Clear();
527
529 cardstack.Push(activepile);
533 }
534 }
535 else if (GetScoreMode() == SCORE_STD)
536 {
538 if ((dwWasteCount >= dwWasteTreshold) && (activepile.NumCards() != 0))
539 {
541 lScore = lScore >= 20 ? lScore - 20 : 0;
542 else
543 lScore = lScore >= 100 ? lScore - 100 : 0;
544 }
545
546 pile.Clear();
547
549 cardstack.Push(activepile);
552
554 }
555 else
556 {
557 pile.Clear();
558
560 cardstack.Push(activepile);
564 }
565
566 dwWasteCount++;
567 }
568 else
569 {
570 int numcards = min((dwOptions & OPTION_THREE_CARDS) ? 3 : 1, cardstack.NumCards());
571
573
574 //make a "visible" copy of these cards
576 temp = cardstack.Pop(numcards);
577 temp.Reverse();
578
580 pile.Clear();
581
582 pile.Push(temp);
583
584 //remove the top 3 from deck
586
587 VisiblePileCards = numcards;
588 }
589
591
592 pDeck->SetCardStack(cardstack);
593 pPile->SetCardStack(pile);
594
596
597 SolWnd.Redraw();
598 TRACE("EXIT DeckClickProc()\n");
599}
#define CS_DEFXOFF
Definition: cardlib.h:23
void SetCardStack(const CardStack &cs)
Definition: cardregion.cpp:390
void SetOffsets(int x, int y)
Definition: cardregion.cpp:228
void Push(const Card card)
Definition: cardstack.cpp:83
void Clear()
Definition: cardstack.cpp:37
void Print()
Definition: cardstack.cpp:222
void Reverse()
Definition: cardstack.cpp:73
Card Pop()
Definition: cardstack.cpp:127
void Redraw(void)
Definition: cardwindow.cpp:553
#define min(a, b)
Definition: monoChain.cc:55
static calc_node_t temp
Definition: rpn_ieee.c:38
CardRegion * pDeck
Definition: solcreate.cpp:3
CardRegion * pPile
Definition: solcreate.cpp:4
int VisiblePileCards
Definition: solgame.cpp:13
bool fGameStarted
Definition: solgame.cpp:15
CardStack activepile
Definition: solgame.cpp:12
void FixIfOneCardLeft(void)
Definition: solgame.cpp:465
DWORD dwWasteCount
Definition: solitaire.cpp:28
DWORD dwWasteTreshold
Definition: solitaire.cpp:29
DWORD dwOptions
Definition: solitaire.cpp:25
void UpdateStatusBar(void)
Definition: solitaire.cpp:150
int GetScoreMode(void)
Definition: solitaire.cpp:130
CardWindow SolWnd
Definition: solitaire.cpp:34
long lScore
Definition: solitaire.cpp:31
#define PILE_ID
Definition: solitaire.h:40
#define OPTION_THREE_CARDS
Definition: solitaire.h:11
#define SCORE_STD
Definition: solitaire.h:45
#define SCORE_VEGAS
Definition: solitaire.h:46
void SetUndo(int set_source_id, int set_destination_id, int set_number_of_cards, int set_prev_score, int set_prev_visible_pile_cards)
Definition: solundo.cpp:27
#define DECK_ID
Definition: solitaire.h:39

Referenced by CreateSol().

◆ FindSuitStackFromCard()

CardRegion * FindSuitStackFromCard ( Card  card)

Definition at line 323 of file solgame.cpp.

324{
325 TRACE("ENTER FindSuitStackFromCard()\n");
326
327 for(int i = 0; i < 4; i++)
328 {
329 if(CanDrop(*pSuitStack[i], card))
330 {
331 TRACE("EXIT FindSuitStackFromCard()\n");
332 return pSuitStack[i];
333 }
334 }
335
336 TRACE("EXIT FindSuitStackFromCard()\n");
337 return 0;
338}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
CardRegion * pSuitStack[4]
Definition: solcreate.cpp:5
bool CanDrop(CardRegion &stackobj, Card card)
Definition: solgame.cpp:197

Referenced by RowStackDblClickProc().

◆ FixIfOneCardLeft()

void FixIfOneCardLeft ( void  )

Definition at line 465 of file solgame.cpp.

466{
467 // If there is just 1 card left, then modify the
468 // stack to contain ALL the face-up cards. The effect
469 // will be, the next time a card is dragged, all the
470 // previous card-triplets will be available underneath.
471 if ((dwOptions & OPTION_THREE_CARDS) && pPile->NumCards() == 1)
472 {
473 pPile->SetOffsets(0, 0);
475 }
476}
int NumCards() const
Definition: cardregion.cpp:544

Referenced by DeckClickProc(), and PileRemoveProc().

◆ NewGame()

void NewGame ( void  )

Definition at line 18 of file solgame.cpp.

19{
20 TRACE("ENTER NewGame()\n");
21 int i, j;
22
24 {
26 lScore = lScore - 52;
27 else
28 lScore = -52;
29
32 else
34
35 }
36 else
37 {
40 else
42
43 lScore = 0;
44 }
45
46 dwTime = 0;
47 dwWasteCount = 0;
48 LastId = 0;
49
51
52 //create a new card-stack
54 deck.NewDeck();
55 deck.Shuffle();
58
59 //deal to each row stack..
60 for(i = 0; i < NUM_ROW_STACKS; i++)
61 {
63 temp.Clear();
64
66
67 for(j = 0; j <= i; j++)
68 {
69 temp.Push(deck.Pop());
70 }
71
73 }
74
75 //put the other cards onto the deck
77 pDeck->Update();
78
79 // For the 1-card-mode, all cards need to be completely overlapped
81 pPile->SetOffsets(0, 0);
82
83 SolWnd.Redraw();
84
85 fGameStarted = false;
86
88
90 ClearUndo();
91
92 TRACE("EXIT NewGame()\n");
93
94}
#define CS_FACE_DOWNUP
Definition: cardlib.h:53
void SetFaceDirection(UINT uDirType, int nOption)
Definition: cardregion.cpp:258
void Update()
Definition: cardregion.cpp:207
void NewDeck()
Definition: cardstack.cpp:42
void Shuffle()
Definition: cardstack.cpp:50
void EmptyStacks(void)
Definition: cardwindow.cpp:607
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
CardRegion * pRowStack[NUM_ROW_STACKS]
Definition: solcreate.cpp:6
int LastId
Definition: solgame.cpp:14
DWORD dwTime
Definition: solitaire.cpp:27
DWORD dwPrevMode
Definition: solitaire.cpp:30
#define OPTION_KEEP_SCORE
Definition: solitaire.h:13
#define NUM_ROW_STACKS
Definition: solitaire.h:38
void ClearUndo(void)
Definition: solundo.cpp:45
CardStack deck
Definition: spigame.cpp:18

Referenced by DifficultyDlgProc(), ShowGameOptionsDlg(), SuitStackAddProc(), and WndProc().

◆ PileClickProc()

void CARDLIBPROC PileClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 438 of file solgame.cpp.

439{
440 TRACE("ENTER SuitStackClickProc()\n");
441
442 fGameStarted = true;
443
444 LastId = stackobj.Id();
445
446 TRACE("EXIT SuitStackClickProc()\n");
447}

Referenced by CreateSol().

◆ PileDblClickProc()

void CARDLIBPROC PileDblClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 452 of file solgame.cpp.

453{
454 TRACE("ENTER PileDblClickProc()\n");
455
456 SetPlayTimer();
457
458 RowStackDblClickProc(stackobj, iNumClicked);
459 TRACE("EXIT PileDblClickProc()\n");
460}
void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked)
Definition: solgame.cpp:403

Referenced by CreateSol().

◆ PileRemoveProc()

void CARDLIBPROC PileRemoveProc ( CardRegion stackobj,
int  iItems 
)

Definition at line 481 of file solgame.cpp.

482{
483 TRACE("ENTER PileRemoveProc()\n");
484
485 SetPlayTimer();
486
487 //modify our "virtual" pile by removing the same card
488 //that was removed from the physical card stack
489 activepile.Pop(iItems);
491 {
493 }
494
496
497 TRACE("EXIT PileRemoveProc()\n");
498}

Referenced by CreateSol().

◆ RowStackClickProc()

void CARDLIBPROC RowStackClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 291 of file solgame.cpp.

292{
293 TRACE("ENTER RowStackClickProc()\n");
294 int numfacedown;
295
296 stackobj.GetFaceDirection(&numfacedown);
297
298 //if all face-down, then make top card face-up
299 if(stackobj.NumCards() == numfacedown)
300 {
301 if(numfacedown > 0) numfacedown--;
302 stackobj.SetFaceDirection(CS_FACE_DOWNUP, numfacedown);
303 stackobj.Redraw();
304
305 if (GetScoreMode() == SCORE_STD)
306 {
307 lScore = lScore + 5;
309 }
310 ClearUndo();
311 }
312
313 LastId = stackobj.Id();
314
315 fGameStarted = true;
316
317 TRACE("EXIT RowStackClickProc()\n");
318}
void Redraw()
UINT GetFaceDirection(int *pnOption)
Definition: cardregion.cpp:273

Referenced by CreateSol().

◆ RowStackDblClickProc()

void CARDLIBPROC RowStackDblClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 403 of file solgame.cpp.

404{
405 TRACE("ENTER RowStackDblClickProc()\n");
406
407 SetPlayTimer();
408
409 //can only move 1 card at a time
410 if(iNumClicked != 1)
411 {
412 TRACE("EXIT RowStackDblClickProc()\n");
413 return;
414 }
415
416 //find a suit-stack to move the card to...
417 const CardStack &cardstack = stackobj.GetCardStack();
418 CardRegion *pDest = FindSuitStackFromCard(cardstack[0]);
419
420 if(pDest != 0)
421 {
422 fGameStarted = true;
423 SetPlayTimer();
424
425 //stackobj.MoveCards(pDest, 1, true);
426 //use the SimulateDrag function, because we get the
427 //AddProc callbacks called for us on the destination stacks...
428 bAutoroute = true;
429 stackobj.SimulateDrag(pDest, 1, true);
430 bAutoroute = false;
431 }
432 TRACE("EXIT RowStackDblClickProc()\n");
433}
bool SimulateDrag(CardRegion *pDestStack, int nNumCards, bool fAnimate)
Definition: cardregion.cpp:636
CardRegion * FindSuitStackFromCard(Card card)
Definition: solgame.cpp:323
bool bAutoroute
Definition: solgame.cpp:16

Referenced by CreateSol(), and PileDblClickProc().

◆ RowStackDragProc()

bool CARDLIBPROC RowStackDragProc ( CardRegion stackobj,
int  iNumDragCards 
)

Definition at line 104 of file solgame.cpp.

105{
106 TRACE("ENTER RowStackDragProc()\n");
107 int numfacedown;
108 int numcards;
109
110 SetPlayTimer();
111
112 stackobj.GetFaceDirection(&numfacedown);
113
114 numcards = stackobj.NumCards();
115
116 TRACE("EXIT RowStackDragProc()\n");
117 if(iNumDragCards <= numcards-numfacedown)
118 return true;
119 else
120 return false;
121
122}

Referenced by CreateSol().

◆ RowStackDropProc()

bool CARDLIBPROC RowStackDropProc ( CardRegion stackobj,
CardStack dragcards 
)

Definition at line 128 of file solgame.cpp.

129{
130 TRACE("ENTER RowStackDropProc()\n");
131 Card dragcard = dragcards[dragcards.NumCards() - 1];
132
133 SetPlayTimer();
134
135 //if we are empty, can only drop a stack with a King at bottom
136 if(stackobj.NumCards() == 0)
137 {
138 if(dragcard.LoVal() != 13)
139 {
140 TRACE("EXIT RowStackDropProc(false)\n");
141 return false;
142 }
143 }
144 else
145 {
146 const CardStack &mystack = stackobj.GetCardStack();
147
148 //can only drop if card is 1 less
149 if(mystack[0].LoVal() != dragcard.LoVal() + 1)
150 {
151 TRACE("EXIT RowStackDropProc(false)\n");
152 return false;
153 }
154
155 //can only drop if card is different colour
156 if( (mystack[0].IsBlack() && !dragcard.IsRed()) ||
157 (!mystack[0].IsBlack() && dragcard.IsRed()) )
158 {
159 TRACE("EXIT RowStackDropProc(false)\n");
160 return false;
161 }
162 }
163
164 fGameStarted = true;
165
166 SetUndo(LastId, stackobj.Id(), dragcards.NumCards(), lScore, VisiblePileCards);
167
168 if (LastId == PILE_ID)
169 {
170 if (GetScoreMode() == SCORE_STD)
171 {
172 lScore = lScore + 5;
173 }
174 }
175 else if ((LastId >= SUIT_ID) && (LastId <= SUIT_ID + 3))
176 {
177 if (GetScoreMode() == SCORE_STD)
178 {
179 lScore = lScore >= 15 ? lScore - 15 : 0;
180 }
181 else if (GetScoreMode() == SCORE_VEGAS)
182 {
183 lScore = lScore >= -47 ? lScore - 5 : -52;
184 }
185 }
186
188
189 TRACE("EXIT RowStackDropProc(true)\n");
190 return true;
191}
Definition: card.h:28
bool IsRed() const
Definition: card.h:94
#define SUIT_ID
Definition: solitaire.h:41

Referenced by CreateSol().

◆ SuitStackAddProc()

void CARDLIBPROC SuitStackAddProc ( CardRegion stackobj,
const CardStack added 
)

Definition at line 346 of file solgame.cpp.

347{
348 TRACE("ENTER SuitStackAddProc()\n");
349 bool fGameOver = true;
350
351 SetPlayTimer();
352
353 for(int i = 0; i < 4; i++)
354 {
355 if(pSuitStack[i]->NumCards() != 13)
356 {
357 fGameOver = false;
358
359 break;
360 }
361 }
362
363 if(fGameOver)
364 {
366 PlayTimer = 0;
367
369 {
370 lScore = lScore + (700000 / dwTime);
371 }
372
374 ClearUndo();
375
377
378 for(int i = 0; i < 4; i++)
379 {
380 pSuitStack[i]->Flash(11, 100);
381 }
382
384 {
385 NewGame();
386 }
387 else
388 {
390
391 fGameStarted = false;
392 }
393 }
394
395 TRACE("EXIT SuitStackAddProc()\n");
396}
void Flash(int count, int timeout)
Definition: cardregion.cpp:322
TCHAR MsgDeal[128]
Definition: solitaire.cpp:24
TCHAR MsgWin[128]
Definition: solitaire.cpp:23
void NewGame(void)
Definition: solgame.cpp:18
TCHAR szAppName[128]
Definition: solitaire.cpp:18
HWND hwndMain
Definition: solitaire.cpp:13
UINT_PTR PlayTimer
Definition: solitaire.cpp:32
#define IDT_PLAYTIMER
Definition: solitaire.h:33
#define OPTION_SHOW_TIME
Definition: solitaire.h:12
#define MB_YESNO
Definition: winuser.h:817
#define MB_OK
Definition: winuser.h:790
#define MB_ICONQUESTION
Definition: winuser.h:789
#define MessageBox
Definition: winuser.h:5831
#define MB_ICONINFORMATION
Definition: winuser.h:802
#define IDYES
Definition: winuser.h:835
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by CreateSol().

◆ SuitStackClickProc()

void CARDLIBPROC SuitStackClickProc ( CardRegion stackobj,
int  iNumClicked 
)

Definition at line 276 of file solgame.cpp.

277{
278 TRACE("ENTER SuitStackClickProc()\n");
279
280 fGameStarted = true;
281
282 LastId = stackobj.Id();
283
284 TRACE("EXIT SuitStackClickProc()\n");
285}

Referenced by CreateSol().

◆ SuitStackDropProc()

bool CARDLIBPROC SuitStackDropProc ( CardRegion stackobj,
CardStack dragcards 
)

Definition at line 235 of file solgame.cpp.

236{
237 TRACE("ENTER SuitStackDropProc()\n");
238
239 SetPlayTimer();
240
241 //only drop 1 card at a time
242 if (!bAutoroute && dragcards.NumCards() != 1)
243 {
244 TRACE("EXIT SuitStackDropProc()\n");
245 return false;
246 }
247
248 bool b = CanDrop(stackobj, dragcards[0]);
249 TRACE("EXIT SuitStackDropProc()\n");
250
251 if (b)
252 {
253 SetUndo(LastId, stackobj.Id(), 1, lScore, VisiblePileCards);
254
255 if ((LastId == PILE_ID) || (LastId >= ROW_ID))
256 {
257 if (GetScoreMode() == SCORE_VEGAS)
258 {
259 lScore = lScore + 5;
260 }
261 else if (GetScoreMode() == SCORE_STD)
262 {
263 lScore = lScore + 10;
264 }
265
267 }
268 }
269
270 return b;
271}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
#define ROW_ID
Definition: solitaire.h:42

Referenced by CreateSol().

Variable Documentation

◆ activepile

CardStack activepile

Definition at line 12 of file solgame.cpp.

Referenced by CreateSol(), DeckClickProc(), FixIfOneCardLeft(), NewGame(), PileRemoveProc(), and Undo().

◆ bAutoroute

bool bAutoroute = false

Definition at line 16 of file solgame.cpp.

Referenced by RowStackDblClickProc(), and SuitStackDropProc().

◆ fGameStarted

◆ LastId

◆ MsgDeal

TCHAR MsgDeal[128]
extern

Definition at line 24 of file solitaire.cpp.

Referenced by SuitStackAddProc().

◆ MsgWin

TCHAR MsgWin[128]
extern

Definition at line 23 of file solitaire.cpp.

Referenced by SuitStackAddProc().

◆ VisiblePileCards

int VisiblePileCards