ftp.nice.ch/pub/next/games/network/Splat.1.0.s.tar.gz#/Splat-1.0/SplatGame.h

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

/*
 * SplatGame
 * description: implementation of the SplatGame class
 * 		a class to keep track of the state of a splat game instance
 * history:
 *	5/1/93 [Erik Kay] - converted much of the SplatController to here
 *	6/8/93 [Erik Kay] - better network support
 */
 
#import <appkit/appkit.h>
#import "Player.h"
#import "SplatRules.h"
#import "Board.h"

enum game_state { NO_GAME, GAME_OVER, GAME_PAUSED, GAME_RUNNING };

#define MOVE_SOUND	0
#define CHANGE_SOUND	1
#define BIGCHANGE_SOUND	2
#define WOWCHANGE_SOUND	3
#define GAMEOVER_SOUND	4
#define WIN_SOUND	5

@interface SplatGame:Object
{
    Board *board, *origBoard;
    SplatRules *rules;
    id	player1;
    id	player2;
    id	currentPlayer;
    id	otherPlayer;
    id	winner;
    enum game_state gameState;
    move_list moves;
    move_list *last_move;
    id	boardWindow;
    id	boardView;
    id	player1ColorView;
    id	player1PiecesField;
    id	player1Name;
    id	player2ColorView;
    id	player2PiecesField;
    id	player2Name;
    
    id	playButton;
    id	pauseButton;
    id	stopButton;
    id	undoButton;

    NXConnection *myConnection;
    NXPort *threadPort;
}

- initNetPlayers;

- setBoard:(Board *)b;
- updateBoard:(Board *)b;
- (Board *)board;
- setRules:(SplatRules *)r;
- (SplatRules *)rules;

- setPlayer1:(Player *)p;
- (Player *)player1;
- setPlayer2:(Player *)p;
- (Player *)player2;
- (Player *)winner;
- (Player *)currentPlayer;
- (Player *)otherPlayer;

- setGameState:(enum game_state)state;
- (enum game_state)gameState;
- updateCount;

- doNextMove;
- doMove:(move *)mv;
- startMove:(move *)mv;
- doUndoMove:sender;

- showGame;
- initGame;
- startGame:sender;
- pauseGame:sender;
- stopGame:sender;
- gameOver;
- resetGame;
- resetBoard;

- (NXPort *)inPort;

- windowWillClose:sender;

@end

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