#include <stdio.h>

#define MAX_STRING 50
#define MAX_RACES 10
#define MAX_HORSES 20
#define FRACTIONS 4

// enumerated type for race surface
enum surface
{
    DIRT,
    TURF,
    SYNTHETIC
};

// enumerated type for track condition
enum track_condition
{
    FAST,
    WET_FAST,
    GOOD,
    SLOW,
    MUDDY,
    SLOPPY,
    SEALED,
    FIRM,
    YIELDING,
    SOFT,
    HEAVY
};

// enumerated type for horse gender
enum horse_gender
{
    GELDING,
    COLT,
    FILLY,
    MARE,
    RIG
};

// enumerated type for race type
enum race_type
{
	MDN,
	MSW,
	CLM,
	ALW,
	STA,
	STR,
	CST,
	MOC,
	INV,
	TRL,
	STK,
	MCL,
	OCL,
	AOC,
	HCP,
	SHP,
	SOC,
	MST,
	DBY,
	FTR
};

// enumerated type for horse color
enum horse_color
{
	B,
	BL,
	BR,
	CH,
	GR,
	RO,
	WH
};

// enumerated type for distance
enum distance
{
	SPRINT,
	MIDDLE,
	LONG
};

// supporting date structure
struct date
{
    int month;
    int day;
    int year;
};

//supporting time structure
struct time
{
    int hour;
    int minute;	
};

//supporting race time structure
struct race_time
{
	int minute;
	float second;
};


// supporting race performance structure
struct performance
{
    int starts;
    int wins;
    int places;
    int shows;
    float earnings;
};

//supporting totals structure
struct totals
{
	struct performance currentYearTotals;
	struct performance previousYearTotals;
	struct performance LifetimeTotals;
	struct performance trackTotals;
	struct performance dirtTotals;
	struct performance wetDirtTotals;
	struct performance allWeatherTotals;
	struct performance atDistanceTotals;
};


// supporting jockey structure
struct jockey
{
    char jockeyName[MAX_STRING];
    float jockeyWeight;
    struct performance record;

};

//supporting owner structure
struct owner
{
	char ownerName[MAX_STRING];
	char silks[MAX_STRING];
};

//supporting trainer structure
struct trainer
{
	char trainerName[MAX_STRING];
	struct performance record;
};

//supporting horse structure
struct horse
{
	char horseName[MAX_STRING];        // horse name
    enum horse_gender horseGender;         // horse gender
	struct owner horseOwner;
	struct trainer horseTrainer;
	int horseAge;                          // horse age
	enum horse_color horseColor;
	char sireName[MAX_STRING];        // horse's Sire's name
	char damName[MAX_STRING];        // horse's Dam's name
	int daysUnraced;
	struct totals raceTotals;
};

//supporting race condition structure
struct race_condition
{
	int purse;
	char raceDescription[MAX_STRING];
	int ageRestriction;
	int weightAssignment;
	char claimingCondition[MAX_STRING];
	int raceDistance;
	
};

//supporting track record holder structure
struct track_record_holder
{
	char horseName[MAX_STRING];        // horse name
	int horseAge;                          // horse age at time of race
	float weightCarried;                   // weight carried by horse at time of recored
	struct race_time recordTime;				//record time
	struct performance record;        // past performance record
};


struct claiming_information
{
	char newOwnerName[MAX_STRING];
	char previousOwnerName[MAX_STRING];
	char formerTrainerName[MAX_STRING];
	float claimingPrice;
};




// structure to store details on each race
struct race_details
{
    struct date raceDate;          //date of the race
    struct time raceTime;			//time of the race
    char wagersAvailable[MAX_STRING];		   //shows the type of wager you can use to bet in that specific race including the exotic bets
    int raceNumber;                        //race number
    char trackName[MAX_STRING];       	  // track name
    int raceRating;						  //estimate of what the winner of today’s race will earn for an Equibase Speed Figure 
    enum race_type raceType;			  // what type of race is the event about
    enum surface raceSurface;             // dirt, turf, synthetic
    enum track_condition condition;        // track condition
	struct race_condition raceCondition;   //includes the purse, detailed description of the race, age restriction/condition, weight assignments, claiming condition and distance of the race.
    struct track_record_holder trackRecord; //contains the track record holder information including the horse’s name, his age, the weight carried and the time and the horse’s race record (wins, places, shows).This will reflect the record on the same surface at the same distance by the same breed type.

};

// add a structure to store details on each horse
struct horse_details_and_past_performance
{
    int programNumber;                     // program number
    char saddleClothColor[MAX_STRING];
    float morningLineOdds;           // morning line odds
	struct horse raceHorse;
	char medicationAndEquipment[MAX_STRING];		   //indicates the types of medication and equipment the horse will be using. Medication will always be listed with a capital letter
    float weightCarried;                   // assigned weight
    struct jockey horseJockey;             // jockey information
	int horseClassFigure;
	int lastSpeedFigure;
	char trackCode[3];
	int raceNumber;
	enum track_condition trackCondition;
	enum surface trackSurface;             // dirt, turf, synthetic
	enum distance raceDistance;
	struct race_time fractionalTimes[FRACTIONS];
	int paceFigure;
	int postPosition;
	int finalPosition;
	float finalOdds;
	char shortFootnotes[MAX_STRING];
	struct claiming_information claimInfo;
	char workoutLines[MAX_STRING];
	char fillieRestricted;
	char stateBredRestricted;
	int fieldSize;
	
	
};

// **************************************************
// Function: main
//
// Description: declares arrays of race and horse
//              structures to test that the code compiles
//
// Parameters: none
//
// Returns: 0
//
// **************************************************

int main()
{
    // NOTE: You do not have to populate these
    struct race_details myRaces[MAX_RACES];
    struct horse_details_and_past_performance myHorses[MAX_HORSES];

    return 0;
}
