// 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
