ftp.nice.ch/pub/next/games/card/NEXTVegas3.0.src.tar.gz#/NEXTVegas/Template/Template.m

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

#import "Template.h"

@implementation Template
/***************************************************************************************
 *                                 Module Methods                                      *
 ***************************************************************************************/
- awakeFromNib
/*
	Sent to every object instantiated in a nib file.  A good place to perform some
	initialization...
*/
{
 	return self;
}

/***************************************************************************************
 *                            Inspector And Rules Methods                              *
 ***************************************************************************************/
- (BOOL)hasRules
/*
	NO if the module does not have a Rules Window, YES if it does.  The default
	method returns NO.
*/
{
	return YES;
}

- inspectorWillBeRemoved:sender
/*
	Sent when this module's inspector is about to be replace with another one.
*/
{
	return self;
}

- inspectorWasInstalled:sender
/*
	Sent just after this module's inspector has been installed.
*/
{
	return self;
}

- setPreferences:sender
/*
	Sent by Prefs() when player hits the set button on the Inspector
		Write your preferences to the Defaults database if needed.
		Should return self if preferences were saved, nil if not.
*/
{
	return nil;
}

- revertPreferences:sender
/*
	Sent by Prefs() when player hits the revert button on the Inspector
		Reset the objects in your inspector if needed.
		Should return self if preferences were reverted, nil if not.
*/
{
	return nil;
}

- preferencesChanged:sender
/*
	If set up properly, any objects in your inspector should send your dealer this
	message when the user changes one of them (i.e when they change a switch).
	
	Make sure that the objects in your inspector send this message to your object by
	connecting them in IB to send this method call.  If you need to update any preference 
	related variables, here's where to do it.
*/
{
	// so that Prefs() knows to enable the set & revert buttons on the inspector...
	[super preferencesChanged:sender];
	
	return self;
}


/***************************************************************************************
 *                                  Player Methods                                     *
 ***************************************************************************************/
- (int)collectAllBetsForPlayer:(int)playerNum
{
	return 0;
}

- playerDidBet:aPlayer
{
	return self;
}

- playerDidClose:aPlayer
/*
 *  Sent after a player has closed and is no longer part of the game.  No messages
 *  should be sent to aPlayer.  This method should just do some internal cleanup
 *  if necessary.
 */
{
	return self;
}

- playerDidJoin:player
{
	return self;
}

- (BOOL)playerWillClose:aPlayer
/*
 *  Should return YES if it is okay to close this player, NO if it is not.  The
 *  default implementation returns YES.
 */
{
    return YES;
}

- (BOOL)playerWillJoin:sender
{
	return YES;
}

/***************************************************************************************
 *                                  Table Methods                                      *
 ***************************************************************************************/
- view:aView wasLoadedOnTable:tableObject
{
	table = tableObject;

	return self;
}

/***************************************************************************************
 *                               Other Misc. Methods                                   *
 ***************************************************************************************/
- finishSessionAndClose
/*
	This message is sent when a new game is being loaded.  If there is any clean up
	to do, this is where to do it.
*/
{
	return self;
}

@end

@implementation NVDealer(BetViewDelegate)

- mouseEnteredView:sender
/*
	When a mouse enters a tableView, it sends this message to us.  We use it to
	update the tableAdvice text field.
*/
{
    return self;
}

- mouseExitedView:sender
{
	return self;
}

- player:aPlayer willBet:(int)betType onView:aBetView
{
	return self;
}

- (BOOL)playerWillDragChipAtRow:(int)row andCol:(int)col fromView:sender
/*
	Sent by a BetView when a player wishes to drag a chip pile.  Overwrite this
	method to return YES if your module will allow drag and drop.
*/
{
	return NO;
}

- playerDraggedChipAtRow:(int)row andCol:(int)col fromView:sender
/*
	Sent by a BetView after a player drags a chip pile.  
*/
{
	return self;
}

- (BOOL)playerWillDropChipAtRow:(int *)row andCol:(int *)col InView:sender
/*
	Sent by a BetView when a player wants to drop a chip pile on it.  Over write this
	method to return YES if your module allows drag and drop.
*/
{
	return NO;
}

- playerDroppedChipAtRow:(int)row andCol:(int)col inView:sender
/*
	Sent by a BetView when a player drops a chip on it.  Overwrite this method to add
	the pile to the betview.  Check out the blackjack module to see how this is done.
*/
{
	return self;
}

@end

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