#import "RaceDayControlPanelController.h"

@implementation RaceDayControlPanelController

- delegate
	{
	return delegate;
	}


- setDelegate:sender
	{
	delegate = sender;
	return self;
	}


- raceLapsChanged:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (int)raceLaps
	{
	return [raceLapsTextField intValue];
	}


- setRaceLaps:(int)theRaceLaps
	{
	[raceLapsTextField setIntValue:theRaceLaps];
	return self;
	}


- raceOpponentsChanged:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (int)raceOpponents
	{
	return [raceOpponentsTextField intValue];
	}


- setRaceOpponents:(int)theRaceOpponents
	{
	[raceOpponentsTextField setIntValue:theRaceOpponents];
	return self;
	}


- racerCarColor1Changed:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (NXColor)racerCarColor1
	{
	return [racerCarColor1ColorWell color];
	}


- setRacerCarColor1:(NXColor)theRacerCarColor1
	{
	[racerCarColor1ColorWell setColor:theRacerCarColor1];
	return self;
	}


- racerCarColor2Changed:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (NXColor)racerCarColor2
	{
	return [racerCarColor2ColorWell color];
	}


- setRacerCarColor2:(NXColor)theRacerCarColor2
	{
	[racerCarColor2ColorWell setColor:theRacerCarColor2];
	return self;
	}


- racerMaxSpeedChanged:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (float)racerMaxSpeed
	{
	return [racerMaxSpeedTextField floatValue];
	}


- setRacerMaxSpeed:(float)theRacerMaxSpeed
	{
	[racerMaxSpeedTextField setFloatValue:theRacerMaxSpeed];
	return self;
	}


- raceTrackOvalSizeChanged:sender
	{
	[self controlsChanged:sender];
	return self;
	}


- (NXSize *)raceTrackOvalSize
	{
	raceTrackOvalSize.width = [raceTrackOvalWidthTextField floatValue];
	raceTrackOvalSize.height = [raceTrackOvalHeightTextField floatValue];
	return &raceTrackOvalSize;
	}


- setRaceTrackOvalSize:(NXSize *)theRaceTrackOvalSize
	{
	[raceTrackOvalWidthTextField setFloatValue:(theRaceTrackOvalSize->width)];
	[raceTrackOvalHeightTextField setFloatValue:(theRaceTrackOvalSize->height)];
	return self;
	}


- controlsChanged:sender
	{
	[delegate controlsChanged:self];
	return self;
	}


- orderFront:sender
	{
	return [window orderFront:sender];
	}


- orderOut:sender
	{
	return [window orderOut:sender];
	}


- setDefaults:sender
	{
	[delegate setDefaults:self];
	return self;
	}

@end
