docs: update documentation for normalized config and improve command
- Add improve command to all command tables and usage sections - Add normalized_config field to BestCarRecord struct documentation - Update CarCounts.by_rid type from String to (String, String) - Update CarCounts.guid_to_rid type to HashMap<String, HashSet<(String, String)>> - Add owned_configs field to MyCarsData and CarCounts docs - Add normalize_to_final_build() to API docs - Update CSV format examples to include FinalBuild column - Update my_cars.json structure with engineMajor/weightMajor/chassisMajor - Update timing file example with v2c_ version prefix - Add version prefix stripping to data transformation docs - Update CHANGELOG.md with Unreleased section - Fix compare_records description to include normalized config sorting
This commit is contained in:
parent
bf21d3d1f6
commit
2b0602d564
6 changed files with 204 additions and 84 deletions
|
|
@ -56,11 +56,17 @@ This document describes the JSON data structures used by the Top Drives Records
|
|||
"playerDeck": [
|
||||
{
|
||||
"cardId": "card_ferrari_f40_1987",
|
||||
"locked": true
|
||||
"locked": true,
|
||||
"engineMajor": 3,
|
||||
"weightMajor": 2,
|
||||
"chassisMajor": 3
|
||||
},
|
||||
{
|
||||
"cardId": "card_mclaren_f1_1993",
|
||||
"locked": false
|
||||
"locked": false,
|
||||
"engineMajor": 2,
|
||||
"weightMajor": 3,
|
||||
"chassisMajor": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -73,11 +79,16 @@ This document describes the JSON data structures used by the Top Drives Records
|
|||
| `playerDeck` | Array | List of user's cards |
|
||||
| `cardId` | String | Unique card identifier |
|
||||
| `locked` | Boolean | Whether card is owned (true = owned) |
|
||||
| `engineMajor` | Number | Engine tune level (optional) |
|
||||
| `weightMajor` | Number | Weight tune level (optional) |
|
||||
| `chassisMajor` | Number | Chassis tune level (optional) |
|
||||
|
||||
**Processing Logic**:
|
||||
- Only `locked: true` cards are considered owned
|
||||
- `cardId` values are matched against car database GUIDs
|
||||
- Used to mark cars as "owned" in analysis results
|
||||
- Tune config extracted as `"{engineMajor}{weightMajor}{chassisMajor}"` (e.g., `"323"`)
|
||||
- Cards with incomplete tune data are skipped for the improve command with a warning
|
||||
|
||||
### 3. Individual Car Timing Files (`times/{rid}.json`)
|
||||
|
||||
|
|
@ -90,7 +101,7 @@ This document describes the JSON data structures used by the Top Drives Records
|
|||
{
|
||||
"users": ["Player1", "Player2"],
|
||||
"data": {
|
||||
"111": {
|
||||
"v2c_111": {
|
||||
"times": {
|
||||
"laguna_a00": {
|
||||
"t": 112.45,
|
||||
|
|
@ -246,7 +257,12 @@ let cars: Vec<Car> = serde_json::from_str(&content)?;
|
|||
// Parse individual car timing file
|
||||
let json_data: Value = serde_json::from_str(&file_content)?;
|
||||
if let Some(configurations) = json_data["data"].as_object() {
|
||||
for (config, entry) in configurations {
|
||||
for (raw_config, entry) in configurations {
|
||||
// Strip version prefix (e.g., "v2c_" from "v2c_233")
|
||||
let config = raw_config
|
||||
.strip_prefix("v2c_")
|
||||
.or_else(|| raw_config.strip_prefix("v1c_"))
|
||||
.unwrap_or(raw_config);
|
||||
if let Some(times) = entry["times"].as_object() {
|
||||
for (track_id, details) in times {
|
||||
// Process each track time
|
||||
|
|
@ -290,8 +306,10 @@ BestCarRecord {
|
|||
year: car.year,
|
||||
rq: car.rq,
|
||||
config: config.clone(),
|
||||
normalized_config: normalize_to_final_build(&config),
|
||||
time,
|
||||
owned: my_cars.contains(&car.guid),
|
||||
prize: car.prize,
|
||||
guid: car.guid.clone(),
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue