param([string]$Source='artifacts/navigation-research/frame-shift-drive.json')
$ErrorActionPreference='Stop'
$inputPath=[IO.Path]::GetFullPath((Join-Path (Split-Path -Parent $PSScriptRoot) $Source))
$sourceDocument=Get-Content -LiteralPath $inputPath -Raw | ConvertFrom-Json
$rows=@($sourceDocument.fsd | Where-Object { $_.maxfuel -gt 0 -and $_.optmass -gt 0 -and $_.fuelmul -gt 0 -and $_.fuelpower -gt 0 } | ForEach-Object {
[ordered]@{symbol=$_.symbol.ToLowerInvariant();optimalMass=$_.optmass;maxFuelPerJump=$_.maxfuel;fuelMultiplier=$_.fuelmul;fuelPower=$_.fuelpower}
})
$outputPath=Join-Path (Split-Path -Parent $PSScriptRoot) 'XFEEDToolBox.Core/Navigation/fsd-reference.json'
[ordered]@{
source='https://github.com/EDCD/coriolis-data/blob/master/modules/standard/frame_shift_drive.json'
sourceSha256=(Get-FileHash -LiteralPath $inputPath -Algorithm SHA256).Hash.ToLowerInvariant()
importedAt=[DateTimeOffset]::UtcNow.ToString('o')
modules=$rows
} | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $outputPath -Encoding utf8
Write-Output "Imported $($rows.Count) public FSD reference records."
param([string]$Source='artifacts/navigation-research/frame-shift-drive.json')
$ErrorActionPreference='Stop'
$inputPath=[IO.Path]::GetFullPath((Join-Path (Split-Path -Parent $PSScriptRoot) $Source))
$sourceDocument=Get-Content -LiteralPath $inputPath -Raw | ConvertFrom-Json
$rows=@($sourceDocument.fsd | Where-Object { $_.maxfuel -gt 0 -and $_.optmass -gt 0 -and $_.fuelmul -gt 0 -and $_.fuelpower -gt 0 } | ForEach-Object {
[ordered]@{symbol=$_.symbol.ToLowerInvariant();optimalMass=$_.optmass;maxFuelPerJump=$_.maxfuel;fuelMultiplier=$_.fuelmul;fuelPower=$_.fuelpower}
})
$outputPath=Join-Path (Split-Path -Parent $PSScriptRoot) 'XFEEDToolBox.Core/Navigation/fsd-reference.json'
[ordered]@{
source='https://github.com/EDCD/coriolis-data/blob/master/modules/standard/frame_shift_drive.json'
sourceSha256=(Get-FileHash -LiteralPath $inputPath -Algorithm SHA256).Hash.ToLowerInvariant()
importedAt=[DateTimeOffset]::UtcNow.ToString('o')
modules=$rows
} | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $outputPath -Encoding utf8
Write-Output "Imported $($rows.Count) public FSD reference records."