This is HumanPlayer.m in view mode; [Download] [Up]
/*
* HumanPlayer
* description: a very simple subclass of Player.
* history:
* 2/15/93 [Erik Kay] - created
*/
#import "HumanPlayer.h"
@implementation HumanPlayer
// we have to respond to the method, but in reality, the SplatGame object
// deals with human player moving, while we do nothing.
- doNextMove:(Board *)b
{
return self;
}
- setPlayerName:(const char *)nm
{
if (playerName) {
free(playerName);
playerName = NULL;
}
if (nm) {
playerName = malloc(strlen(nm) + 1);
strcpy(playerName,nm);
}
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.