My girlfriend enjoys Solitaire Greatest Hits Spider a lot, but missed some features found in other Spider-games. One of them is the ability for the game to auto flip a card after moving the upper card to another tableau.
I took the source and added this. For people who also like to have this, hereby the few lines it took:
Another thing I changed was the ability to have 2 suites instead of 4. There for I added a variable "suiteCount_" to **SolitaireStock.m** and a new
<code>
-(id) initWithDeckCountAndSuiteCount: (NSInteger)deckCount suiteCount:(NSInteger)suiteCount;
</code>
which is a copy of **initWithDeckCount:deckCount**. And add:
<code>
suiteCount\_ = suiteCount;
</code>
Replace the original initWithDeckCount with:
At the reset-method I modified
<code>
for(suit = 0; suit < 4; suit++) {
</code>
to
<code>
for(suit = 0; suit < suiteCount_; suit++) {
if (suiteCount_ == 2 && suit) suit = 2;
</code>
The if-part is very dirty, but is a quick way to have a red and black suite, instead of 2 red suites.
Finally modify at **initializeGame** of **SolitaireSpider.m** (I created a new game called Spider2). Change:
<code>
stock_ = [ initWithDeckCount:4
</code>
to
<code>
stock_ = [ initWithDeckCountAndSuiteCount:4 suiteCount:2];
</code>
That's it. I also modified the vertical spacing between the cards, and a double-click on a King automatically moves a complete set to a clear foundation, but I won't bore you with that ;-)
Daniel, my compliments for the code and structure. It looks very structured and clean. It was very easy to make these changes. Keep up the good work!
regards,
Richard van Zon.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
My girlfriend enjoys Solitaire Greatest Hits Spider a lot, but missed some features found in other Spider-games. One of them is the ability for the game to auto flip a card after moving the upper card to another tableau.
I took the source and added this. For people who also like to have this, hereby the few lines it took:
<code>
SolitaireCard* stackedCard = [tableau cardAtPosition:
[ count] - 1];
if (stackedCard.flipped)
;
</code>
Another thing I changed was the ability to have 2 suites instead of 4. There for I added a variable "suiteCount_" to **SolitaireStock.m** and a new
<code>
-(id) initWithDeckCountAndSuiteCount: (NSInteger)deckCount suiteCount:(NSInteger)suiteCount;
</code>
which is a copy of **initWithDeckCount:deckCount**. And add:
<code>
suiteCount\_ = suiteCount;
</code>
Replace the original initWithDeckCount with:
<code>
-(id) initWithDeckCount: (NSInteger)deckCount {
return ;
}
</code>
This makes sure other games won't break.
At the reset-method I modified
<code>
for(suit = 0; suit < 4; suit++) {
</code>
to
<code>
for(suit = 0; suit < suiteCount_; suit++) {
if (suiteCount_ == 2 && suit) suit = 2;
</code>
The if-part is very dirty, but is a quick way to have a red and black suite, instead of 2 red suites.
Finally modify at **initializeGame** of **SolitaireSpider.m** (I created a new game called Spider2). Change:
<code>
stock_ = [ initWithDeckCount:4
</code>
to
<code>
stock_ = [ initWithDeckCountAndSuiteCount:4 suiteCount:2];
</code>
That's it. I also modified the vertical spacing between the cards, and a double-click on a King automatically moves a complete set to a clear foundation, but I won't bore you with that ;-)
Daniel, my compliments for the code and structure. It looks very structured and clean. It was very easy to make these changes. Keep up the good work!
regards,
Richard van Zon.