This is KlondikePrefs.m in view mode; [Download] [Up]
/* indent:4 tabsize:8 font:fixed-width */
#import "KlondikePrefs.h"
@implementation KlondikePrefs
/*---------------------------------------------------------------------------
|
| - registerPrefs
|
|----------------------------------------------------------------------------
|
| Register the preferences for this game. Called automatically.
|
\---------------------------------------------------------------------------*/
- (void) registerPrefs
{
NSDictionary* defaultsDict;
defaultsDict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObject:@"3"] forKeys:[NSArray arrayWithObject:@"CardsToDraw"]];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDict];
cardsToDraw = [[NSUserDefaults standardUserDefaults] integerForKey:@"CardsToDraw"];
[cardsToDrawMatrix selectCellWithTag:cardsToDraw];
}
/*---------------------------------------------------------------------------
|
| - saveCardsToDraw:sender
|
|----------------------------------------------------------------------------
|
| Save "CardsToDraw" preference.
|
\---------------------------------------------------------------------------*/
- (void) saveCardsToDraw:sender
{
[[NSUserDefaults standardUserDefaults] setInteger:[self cardsToDraw] forKey:@"CardsToDraw"];
}
/*---------------------------------------------------------------------------
|
| - cardsToDraw:sender
|
|----------------------------------------------------------------------------
|
| Return "CardsToDraw" preference.
|
\---------------------------------------------------------------------------*/
- (int) cardsToDraw
{
return cardsToDraw;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.