This is CardPile.h in view mode; [Download] [Up]
/* indent:4 tabsize:8 font:fixed-width */
/*--------------------------------------------------------------------------
| --------------------------------------------------------------------------
|
| CardPile:Object
|
| Instances of this class provide low-level functionality for card
| games. CardPiles contain an ordered list of cards which can be added
| to, removed from or shuffled by clients of the class.
|
| ----------------------------------------------------------------------------
\---------------------------------------------------------------------------*/
#import <appkit/appkit.h>
#import "cardset.h"
#define CS_BOTTOM 0
#define CS_TOP 9999
@interface CardPile:Object
{
id cardList;
CardSize cardSize;
}
/*----------------------------------------------------------------------------
|
| Class initialization
|
\---------------------------------------------------------------------------*/
+ initialize;
/*----------------------------------------------------------------------------
|
| Creating and freeing
|
\---------------------------------------------------------------------------*/
- init;
- initForCardSize:(CardSize)aSize;
- setCardSize:(CardSize)aSize;
- (CardSize)returnSize;
- free;
/*----------------------------------------------------------------------------
|
| Manipluating individual cards
|
\---------------------------------------------------------------------------*/
- addCard:aCard;
- insertCard:aCard at:(int)aPosition;
- addPile:aCardPile;
- addCopyOfPile:aCardPile;
- insertCopyOfPile:aCardPile at:(int)aPosition;
- insertPile:aCardPile at:(int)aPosition;
- removeCard:aCard;
- cardAt:(int)aPosition;
- (int)cardIndex:aCard;
/*----------------------------------------------------------------------------
|
| Manipluating the deck
|
\---------------------------------------------------------------------------*/
- addDeck;
- empty;
- freeCards;
- flip;
- shuffle;
- (int)cardCount;
/*----------------------------------------------------------------------------
|
| Archiving
|
\---------------------------------------------------------------------------*/
- read:(NXTypedStream *)theStream;
- write:(NXTypedStream *)theStream;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.