
#import "EmptySquare.h"
#import "AbstractFilledSquare.h"	/* for foundLegalMove message decl. */

@implementation EmptySquare

- mouseEntered: (NXEvent *) theEvent {
    [NXApp makeSquaresPerform: @selector(checkAdjacencyWith:) with: self];
    return self;
}	/* above, don't do return [...]; someone may depend on return self */

/* Private methods: */

- checkForLegalMoveFrom: sender {
    if ([self distanceTo: sender] <= 2)
	[sender foundLegalMove];
    return self;
}

- foundAdjacent {  /* were found to be adjacent by checkAdjacencyWith: above */
    return [self setIsHighlighted: YES];
}

@end
