ftp.nice.ch/Attic/openStep/games/Solitaire.3.1.s.tgz#/Solitaire.3.1/Games/FortyThieves/FTDrawDelegate.m

This is FTDrawDelegate.m in view mode; [Download] [Up]

#import "FTDrawDelegate.h"
#import <Solitaire/CardSet.h>
#import "localstrings.h"

@implementation FTDrawDelegate

- (void) setDiscardCardPileView:(CardPileView*)theView
{
    discardPileView = theView; 
}


- (void) clickedCard:(Card*)aCard in:(CardPileView*)drawCardPileView
{
    CardPile*   drawCardPile = [drawCardPileView cardPile];
    CardPile*   discardPile = [discardPileView cardPile];
    Card*    	drawCard;
    
    if ([drawCardPile cardCount]) {
        [[drawCardPileView window] disableFlushWindow];
        drawCard = [drawCardPile dealTopCard];
        [drawCard flip];
        [discardPile addCard:drawCard];
        [drawCardPileView display];
        [discardPileView display];
        [[drawCardPileView window] enableFlushWindow];
        [[drawCardPileView window] flushWindow];
    }
    else{
        NSRunAlertPanel(LOCALIZED_GAME_NAME, LOCALIZED_NO_STOCK_CARD, @"OK", nil, nil);
    } 
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.