This is Card.h in view mode; [Download] [Up]
/* indent:4 tabsize:8 font:fixed-width */
/*----------------------------------------------------------------------------
|-----------------------------------------------------------------------------
|
| Card : Object
|
| Instances of this class provide low-level functionality for card games.
| Cards can have a suit, a value, and an orientation. These values can be
| initialized, modified and determined by clients of the class. Cards also
| know how to render themselves on screen.
|
|-----------------------------------------------------------------------------
\----------------------------------------------------------------------------*/
#import <appkit/appkit.h>
#import "cardset.h"
@interface Card:Object
{
CardSuit suit;
CardValue value;
BOOL faceUp;
}
/*---------------------------------------------------------------------------
|
| Class initialization
|
\---------------------------------------------------------------------------*/
+ initialize;
+ drawCardImages;
+ freeCardImages;
+ setCardBackImage:theImage;
+ setCardBack:(CardBack)aBack;
/*---------------------------------------------------------------------------
|
| Creating and freeing
|
\---------------------------------------------------------------------------*/
- init;
- initSuit:(CardSuit)aSuit value:(CardValue)aValue;
- initSuit:(CardSuit)aSuit value:(CardValue)aValue faceUp:(BOOL)anOrientation;
- copyFromZone:(NXZone *)zone;
/*---------------------------------------------------------------------------
|
| Setting Card object state
|
\---------------------------------------------------------------------------*/
- setSuit:(CardSuit)aSuit;
- setValue:(CardValue)aValue;
- flip;
- setFaceUp:(BOOL)aSide;
/*---------------------------------------------------------------------------
|
| Determining Card object state
|
\---------------------------------------------------------------------------*/
- (CardSuit)suit;
- (CardValue)value;
- (BOOL)isFaceUp;
- (CardColor)cardColor;
/*---------------------------------------------------------------------------
|
| Drawing the card
|
\---------------------------------------------------------------------------*/
- drawCardAt:(NXPoint *)thePoint;
- drawContentsAt:(NXPoint *)thePoint;
- drawOutlineAt:(NXPoint *)thePoint;
/*---------------------------------------------------------------------------
|
| 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.