/** * X-Check Result Code Labels and Descriptions * * Display labels for all possible result codes that can appear in * defensive x-check chart rows (5 columns). */ export const X_CHECK_RESULT_LABELS: Record = { // Groundball results G1: 'Groundball Out (best)', G2: 'Groundball Out (good)', G3: 'Groundball Out (weak)', 'G2#': 'Groundball (speed test)', 'G3#': 'Groundball (speed test)', // Singles SI1: 'Single (clean)', SI2: 'Single (through)', // Doubles DO2: 'Double (2-base)', DO3: 'Double (3-base)', // Triples TR3: 'Triple', // Flyball results F1: 'Flyout (deep)', F2: 'Flyout (medium)', F3: 'Flyout (shallow)', // Catcher-specific SPD: 'Speed Check', FO: 'Fly Out', PO: 'Pop Out', } export const X_CHECK_ERROR_LABELS: Record = { NO: 'No Error', E1: 'Error (+1 base)', E2: 'Error (+2 bases)', E3: 'Error (+3 bases)', RP: 'Rare Play (+3 bases)', } /** * Hash result conversions (player mentally resolves based on batter speed) */ export const HASH_CONVERSIONS: Record = { 'G2#': ['G2', 'SI2'], 'G3#': ['G3', 'SI2'], } /** * Get display label for a result code */ export function getResultLabel(code: string): string { return X_CHECK_RESULT_LABELS[code] || code } /** * Get display label for an error result */ export function getErrorLabel(code: string): string { return X_CHECK_ERROR_LABELS[code] || code } /** * Check if a result code is a hash result (requires speed test) */ export function isHashResult(code: string): boolean { return code.endsWith('#') } /** * Check if a result code is SPD (speed check) */ export function isSpdResult(code: string): boolean { return code === 'SPD' } /** * Get conversion options for a hash result */ export function getHashConversions(code: string): string[] | null { return HASH_CONVERSIONS[code] || null }