home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ragnaroek
/
Ragnaroek.img
/
OpponentApp
/
Balder.h
< prev
next >
Wrap
Text File
|
1991-12-09
|
2KB
|
55 lines
#import <mach.h>
#import <appkit/Application.h>
#import "GameState.h"
@interface Balder:Application
{
id statusText; /* the status TextField */
BOOL connected; /* are we currently connected? */
id opponentName; /* our opponent's name */
id opponentFace; /* our opponent's face */
id publicListener; /* an InvitationListener */
id privateListener; /* a RagnarokListener for game information */
id privateSpeaker; /* a RagnarokSpeaker for talking to Ragnarok */
GameState *currentState; /* the current game state */
int ourSide; /* which side we're playing (BLACK or WHITE) */
}
- appDidInit:sender;
- appWillTerminate:sender;
// messages from our publicListener
- (int)invitationFrom:(char *)username onHost:(char *)hostname RSVP:(port_t )rsvpPort Face:(char *)face length:(int)length;
- (int)Game:(char *)game length:(int)length Side:(int)side YourPort:(port_t *)yourPort MyPort:(port_t )myPort MyFace:(char *)myFaceData length:(int)mflen From:(char *)username onHost:(char *)hostname;
// messages from our privateListener
- (int)submitMoveFrom:(int)from To:(int)to;
- (int)submitTentativeMoveFrom:(int)from To:(int)to;
- (int)submitNoTentativeMove;
- (int)submitUndos:(int)howMany;
- (int)submitResetGame;
- (int)submitMessage:(char *)aString;
- (int)goodbye;
- (int)pleaseAllow:(int)tag Undo:(int)howMany;
- (int)pleaseAllow:(int)tag StartOver:(int)ignored;
- (int)pleaseHurryUp:(int)tag;
- (int)allow:(int)tag;
- (int)refuse:(int)tag;
- (int)ok:(int)tag;
// if we're disconnected
- disconnect;
// reading and writing images with TIFF reps to buffers
- (char *)writeImageToBuf:theImage length:(int *)length;
- readImageFromBuf:(const char *)theBuf length:(int)length;
// announcing our decision
- doMove:(struct move)theMove;
// deciding what to do
- decide:sender;
@end