This is CribDrawDelegate.m in view mode; [Download] [Up]
// indent:4 tabsize:4 font:fixed-width
//
// The Cribbage Solitaire module.
//
// Copyright 1994 by David Fedchenko. All rights reserved.
//
#import "CribDrawDelegate.h"
#import "CribLayoutDelegate.h"
#import "../Solitaire/Solitaire.h"
#import "Cribbage.h"
@implementation CribDrawDelegate
//--------------------------------------------------------------------------
// - draggedPile:from:
//
// returns: (BOOL) flag
//
// Indicates that it's OK to drag the card away.
//
//--------------------------------------------------------------------------
- (BOOL)draggedPile:aCardPile from:aCardPileView
{
return YES;
}
//--------------------------------------------------------------------------
// - removedPile:from:
//
// returns: (id) self
//
// When the top card is removed, flip over the new top card and go see if
// the game is over.
//
//--------------------------------------------------------------------------
- removedPile:aCardPile from:aCardPileView
{
[[[aCardPileView cardPile] cardAt:CS_TOP] flip];
[SolGameController() checkForWin];
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.