ftp.nice.ch/pub/next/games/card/Solitaire.2.1.s.tar.gz#/Solitaire.2.1.s/Tenpile/TenpilePrefs.m

This is TenpilePrefs.m in view mode; [Download] [Up]

/* indent:4  tabsize:8  font:fixed-width */

#import "TenpilePrefs.h"

@implementation TenpilePrefs

/*---------------------------------------------------------------------------
|
|    - registerPrefs
|
|    returns: (id) self
|
|----------------------------------------------------------------------------
|
|    Register the preferences for this game.  Called automatically.
|			
\---------------------------------------------------------------------------*/

- registerPrefs
{
    const NXDefaultsVector gameDefaults =
    {
        {"HiddenCards", "3"},
        {NULL, NULL}
    };

    NXRegisterDefaults(gameName, gameDefaults);

    hiddenCards = atoi(NXGetDefaultValue(gameName, "HiddenCards"));
    if (hiddenCards < 0)
      hiddenCards = 0;
    if (hiddenCards > 4)
      hiddenCards = 4;
    [hiddenCardsMatrix selectCellWithTag:hiddenCards];

    return self;
}


- saveHiddenCards:sender
{
    char buffer[80];

    hiddenCards = [hiddenCardsMatrix selectedTag];
    sprintf(buffer, "%d", hiddenCards);
    NXWriteDefault(gameName, "HiddenCards", buffer);
    return self;
}


- (int) hiddenCards
{
    return hiddenCards;
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.