Race penalty application and penalty-aware race result ordering. More...
#include "racepenalties.h"
Go to the source code of this file.
Functions | |
| static int | completedResultLaps (const tSituation *s, const tCarElt *car) |
| Return the result lap count used for final classification. | |
| static void | swapAdjacentCars (tCarElt **cars, int j) |
| Swap adjacent cars and refresh their result positions. | |
| static void | applyPendingPitPenalties (tSituation *s, const tTrackPitInfo *pits) |
| Apply pending drive-through and stop-and-go penalties as time. | |
| void | ReApplyRaceTimePenalties (tSituation *s, const tTrackPitInfo *pits) |
| Apply race time penalties and update same-lap result order. | |
Race penalty application and penalty-aware race result ordering.
Definition in file racepenalties.cpp.
|
static |
Apply pending drive-through and stop-and-go penalties as time.
The estimate assumes 300 km/h on track, the configured pit speed in the pit lane, 10 seconds for pit entry/exit, and 6 extra seconds for a stop-and-go.
| [in,out] | s | Current race situation. |
| [in] | pits | Pit lane information. |
Definition at line 72 of file racepenalties.cpp.
|
static |
Return the result lap count used for final classification.
Race result storage caps cars at one lap beyond the configured race distance and writes completed laps as _laps - 1; penalty ordering uses the same lap group to avoid moving cars across lap boundaries.
| [in] | s | Current race situation. |
| [in] | car | Car to inspect. |
Definition at line 39 of file racepenalties.cpp.
| void ReApplyRaceTimePenalties | ( | tSituation * | s, |
| const tTrackPitInfo * | pits ) |
Apply race time penalties and update same-lap result order.
Existing time penalties are kept, pending drive-through and stop-and-go penalties are converted into estimated time penalties when the race has usable on-track-side pit information, and then penalized cars are moved down only within their current completed-lap group.
| [in,out] | s | Current race situation containing the ordered car list. |
| [in] | pits | Pit lane information used to estimate pending penalty time. |
Definition at line 107 of file racepenalties.cpp.

|
static |
Swap adjacent cars and refresh their result positions.
| [in,out] | cars | Ordered car pointer array. |
| [in] | j | Index of the lower-ranked car before the swap. |
Definition at line 52 of file racepenalties.cpp.