TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
racetrackselect.h File Reference

Helpers for selecting a valid race-manager track. More...

#include <string>
#include <vector>
Include dependency graph for racetrackselect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tReTrackCandidate
 Track directory pair that can be selected by a race manager. More...
struct  tReTrackSelection
 Result of resolving a race-manager track selection. More...

Functions

bool ReTrackFileExists (const char *category, const char *trackName, char *trackFile, int trackFileSize)
 Check whether a track XML file exists and can be parsed.
std::vector< tReTrackCandidate > ReFindAvailableTracks (void)
 Find all available tracks under the current TORCS track search path.
bool ReResolveTrackSelection (void *params, int curTrackIndex, const std::vector< tReTrackCandidate > &availableTracks, tReTrackSelection *selection, bool updateParams)
 Resolve the current race-manager track entry to an available track.

Detailed Description

Helpers for selecting a valid race-manager track.

Definition in file racetrackselect.h.

Function Documentation

◆ ReFindAvailableTracks()

std::vector< tReTrackCandidate > ReFindAvailableTracks ( void )
extern

Find all available tracks under the current TORCS track search path.

Returns
Vector of selectable tracks whose XML files can be read

Definition at line 88 of file racetrackselect.cpp.

Here is the call graph for this function:

◆ ReResolveTrackSelection()

bool ReResolveTrackSelection ( void * params,
int curTrackIndex,
const std::vector< tReTrackCandidate > & availableTracks,
tReTrackSelection * selection,
bool updateParams )
extern

Resolve the current race-manager track entry to an available track.

The configured track is kept when it is present in availableTracks. If it is missing, the first available track in the same category is preferred, otherwise the first available track is used. When updateParams is true, a fallback selection is written back to the current race-manager track section.

Parameters
[in,out]paramsRace-manager parameter handle
[in]curTrackIndexCurrent track section index under RM_SECT_TRACKS
[in]availableTracksOrdered list of valid track candidates
[in,out]selectionResolved track selection result
[in]updateParamstrue to write fallback category/name to params
Returns
true if a valid selection was found

Definition at line 125 of file racetrackselect.cpp.

Here is the call graph for this function:

◆ ReTrackFileExists()

bool ReTrackFileExists ( const char * category,
const char * trackName,
char * trackFile,
int trackFileSize )
extern

Check whether a track XML file exists and can be parsed.

Parameters
[in]categoryTrack category directory name
[in]trackNameTrack directory and XML base name
[in,out]trackFileOptional buffer receiving the generated track XML path
[in]trackFileSizeSize of trackFile in bytes
Returns
true if the track XML exists and was read successfully

Definition at line 66 of file racetrackselect.cpp.

Here is the call graph for this function: