This is VideoPoker.h in view mode; [Download] [Up]
#import <appkit/appkit.h> #import "../NEXTVegas/NVDealer.h" #import "poker.h" /************************************************************************************** * VideoPoker * * * * Video Poker is a one player game that simulates a video poker machine found in * * most casinos. The current player (the player whose window is highest in the * * window list) is the player who is "playing" the game. * * * * This is the third module I wrote for NEXTVegas, as so it is probably the * * most coherent of the three. I would look at this mostly to get ideas on how * * to write modules for the app. It was written in three days, which is pretty * * good considering how long it took me to write the craps game! * * * **************************************************************************************/ #define VP_HIGHLIGHT 1 #define VP_REGULAR 0 struct VP_TableDisplay { id button; id image; id imageH; }; @interface VideoPoker:NVDealer { id deckView; id deckPile; id card1View; id card2View; id card3View; id card4View; id card5View; id card1Button; id card2Button; id card3Button; id card4Button; id card5Button; id drawButton; id coinsPlayedText; id oneCoinButton; id maxCoinsButton; id coinsWonText; id wonText; id propText; id creditText; id coinValueText; id cashOutButton; id propButton; id coinValueButton; id coinPlayDepText; struct _cardField cardField[VP_NUMCARDS]; int coinValue; int maxCoins; BOOL handInProgress; BOOL isFirstCoin; // Sound effects id glissSound; id beepSound; id twoBeepSound; id beepHighSound; // Timed entries for animation of the various payouts DPSTimedEntry payOutTE; int payOutAmount; // Button images BOOL isHighlight; id holdButtonImage; id holdButtonImageH; id cashOutButtonImage; id cashOutButtonImageH; id drawButtonImage; id drawButtonImageH; id oneCoinButtonImage; id oneCoinButtonImageH; id maxCoinsButtonImage; id maxCoinsButtonImageH; id tableButton1; id tableButton2; id tableButton3; id tableButton4; id tableButton5; struct VP_TableDisplay tableArea[5]; // Timed entry for the flashing of the buttons DPSTimedEntry fastFlashTE; } // Initialization methods - awakeFromNib; - setImages; - newDeck; - setCoinValue:sender; // Game flow methods - startGame:sender; - dealCards; - replaceDiscards; - (PokerHand)checkForWin; - endGame:sender; // Pay out methods - payOut:(PokerHand)winType; - payOneToCurrent; // Target/Action methods - cashOut:sender; - draw:sender; - hold:sender; - playOne:sender; - playMax:sender; // Utility methods - fastFlash; // for debugging - getNextCard:sender; - checkHand:sender; - cardValues:sender; // CardPileView delegate methods - clickedCard:aCard in:aCardPileView; - getOffset:(float *)xOffset :(float *)yOffset; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.