ftp.nice.ch/pub/next/games/board/Risk.0.97.s.tar.gz#/RiskSource0.97/Risk/Mover.h

This is Mover.h in view mode; [Download] [Up]

//  Mover.h
// Part of Risk by Mike Ferris

#import <objc/Object.h>
#import <appkit/Responder.h>

// Move phases
#define P_NIL				0
#define P_PLACEARMIES		1
#define P_ATTACK			2
#define P_FORTIFY			3
#define P_CHOOSECOUNTRIES	4

// Place Army move subphases
#define SP_INITIAL		0
#define SP_BEGINTURN	1
#define SP_ATTACK		2
#define SP_FORTIFY		3

// phase results for attack and fortify
#define PR_NIL			0
#define PR_A_VICTORY	1
#define PR_ENDTURN		2
#define PR_A_FORTIFY	3
#define PR_F_PLACE		4

// attackPopup item tags
#define AP_ONCE			0
#define AP_MULTIPLE		1
#define AP_UNTILLEFT	2
#define AP_UNTILCANT	3

#define APN_ONCE		"Once only."
#define APN_MULTIPLE	"A specific number of times."
#define APN_UNTILLEFT	"Until a specific number of armies remain."
#define APN_UNTILCANT	"Until unable to continue."

@interface Mover:Object
{
	// outlets for other main objects
	id	theGameSetup;
	id	riskController;
    id	controlPanel;
	id	theMapView;
	id  computerLogic;
	id	theCardManager;
	id	diceInspector;

	// outlet for custom view in left section of control panel
	id	statusView;
	
	// outlets for controls in middle section of control panel
    id	nameTextField;
    id	phaseTextField;
    id	infoTextField;
	id  colorWell;

	// outlets for interchangeable views in right section of control panel
    id	phaseComputerMove;
    id	phasePlaceArmies;
    id	phaseAttack;
    id	phaseFortify;
	id	phaseChooseCountries;

	// outlets for controls within above phase views
    id	placeArmyView;
    id	placeArmyTextField;
	id	placeArmyTurnInButton;
	id	placeArmyReviewButton;
	id	placeArmyInitTextField;
	id	placeArmyInitStatText;
    id	attackRadio;
    id	attackTextField;
	id	attackSlider;
	id	attackPopupButton;
    id	attackCountry;
	id	attackReviewButton;
	id	fortifyReviewButton;
	
	// current game info
	BOOL gameInProgress;
	int initPlaceArmiesNum;
	int initPlaceArmies[6];
	int fortifyRule;
	
	// current move info
	id  currentPhaseView;
	int currentPhase;
	int placeArmiesSubphase;
	int phaseResults;

	int currentPlayer;
	int currentTurn;
	BOOL currentPlayerGetsCard;

	id  currentCountry;
	id  attackFromCountry;
	id  attackToCountry;
	id  defaultAttackFrom;

	int attackOption[6];
	int attackNum[6];
}

+ initialize;

- appDidInit:sender;

- startNewGame;
- settingsChanged;
- endGame:(int)winner;

- countryClick:country num:(int)n event:(NXEvent *)e;

- placeArmiesInCountry:country num:(int)n event:(NXEvent *)e;
- attackFrom:country num:(int)n;
- attackTo:country num:(int)n event:(NXEvent *)e;
- (BOOL)attackFrom:fc to:tc;
- (BOOL)attackOnceFrom:fc to:tc;
- endTurn:sender;
- fortify:sender;
- fortifyFrom:country num:(int)n;
- (BOOL)canFortifyTo:country;
- chooseCountry:country num:(int)n;

- continuePlay:sender;
- continuePlay;
- goNextPhase;
- phaseChange:(int)phaseNum forPlayer:(int)playerNum;

// targets of phase controls
- attackPopupAction:sender;
- attackSliderAction:sender;
- turnInCardsAction:sender;
- reviewCardsAction:sender;

- (BOOL)isGameInProgress;
- setGameInProgress:(BOOL)flag;

- (int)currentPlayer;

- displayStatusView;

- setDiceInspector:anObject;

@end

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