// TRACK.H - reads the track definition file to define the track and
// set the location of the scoreboard, leaderboard and other display items.
// by Mitchell E. Timin, State College, PA
// see CAR.H for class and structure declarations
// This version is for Borland C++, version 3.1, and is for DOS
// This is part of version 0.60 of RARS (Robot Auto Racing Simulation)
// ver. 0.1 release January 12, 1995
// ver. 0.2 1/23/95
// ver. 0.3 2/7/95
// ver. 0.39 3/6/95
// ver. 0.45 3/21/95
// ver. 0.50 4/5/95
// ver. 0.6b May 8, 1995  b for beta

// The track consists of a sequence of these segments:  (see CARZ.CPP)
struct segment {      // describes an arc or a straight line
   double radius;     // 0.0 means straight line, < 0.0 means right turn
   double length;           // radians if an arc, feet if straight line
   double beg_x, beg_y;     // coordinates of begining of segment
   double end_x, end_y;     // coordinates of end
   double cen_x, cen_y;     // coordinates of arc center (if arc)
   double beg_ang, end_ang; // path angles, radians, 0.0 is in x direction
};

struct track_desc {
   int NSEG;           // number of track segments (see drawpath() in TRACK.CPP)
   double width;       // width of track, feet
   segment *trackout;  // track defining arrays - see TRACK.CPP
   segment *trackin;
};
   
extern double SCALE;        // feet per pixel, mapping track to screen
extern double TRK_STRT_X; // coordinates of where to start drawing track
extern double TRK_STRT_Y;  // (feet)
extern double SCORE_BOARD_X;  // These are in feet, track coordinates
extern double SCORE_BOARD_Y; // (where the scoreboard is located)
extern double LDR_BRD_X;      // upper left corner of leader board, feet
extern double LDR_BRD_Y;
extern double LOTIX, LOTIY;    // where "Length of track... " starts
extern double IP_X, IP_Y;      // Instrument Panel
extern double FINISH;         // fraction of segment 0 prior to finish line
extern double from_start_to_seg1;  // distance from start/finish line to seg end
extern double X_MAX, Y_MAX;   // maximum values that display must show, feet
extern char trackfile[];      // contains string name of file for track input

void build_track(void);       // puts initial data in trackin[], trackout[]

track_desc get_track_description(void);  // returns a track_desc structure
