//! Strongly typed Tracks // Warning: This is an automatically generated file from combos.py use binrw::{BinRead, BinWrite}; use crate::license::License; #[derive(Debug, PartialEq, Eq, Clone, Default)] #[cfg_attr(feature = "serde", derive(serde::Serialize))] /// Handles parsing a Track name. #[non_exhaustive] #[allow(missing_docs)] pub enum Track { #[default] Bl1, Bl1r, Bl1x, Bl1y, Bl2, Bl2r, Bl2x, Bl2y, Bl3, Bl3r, Bl3x, Bl3y, Bl4, Bl4x, So1, So1r, So1x, So1y, So2, So2r, So2x, So2y, So3, So3r, So3x, So3y, So4, So4r, So4x, So4y, So5, So5r, So5x, So5y, So6, So6r, So6x, So6y, Fe1, Fe1r, Fe1x, Fe1y, Fe2, Fe2r, Fe2x, Fe2y, Fe3, Fe3r, Fe3x, Fe3y, Fe4, Fe4r, Fe4x, Fe4y, Fe5, Fe5r, Fe5x, Fe5y, Fe6, Fe6r, Fe6x, Fe6y, Au1, Au1x, Au2, Au2x, Au3, Au3x, Au4, Au4x, Ky1, Ky1r, Ky1x, Ky1y, Ky2, Ky2r, Ky2x, Ky2y, Ky3, Ky3r, Ky3x, Ky3y, We1, We1r, We1x, We1y, We2, We2r, We2x, We2y, We3, #[allow(missing_docs)] We3x, We4, We4r, We4x, We4y, We5, We5r, We5x, We5y, As1, As1r, As1x, As1y, As2, As2r, As2x, As2y, As3, As3r, As3x, As3y, As4, As4r, As4x, As4y, As5, As5r, As5x, As5y, As6, As6r, As6x, As6y, As7, As7r, As7x, As7y, Ro1, Ro1x, Ro2, Ro2x, Ro3, Ro3x, Ro4, Ro4x, Ro5, Ro5x, Ro6, Ro6x, Ro7, Ro7x, Ro8, Ro8x, Ro9, Ro9x, Ro10, Ro10x, Ro11, Ro11x, La1, La1x, La2, La2x, } impl Track { /// What license is required to access this map pub fn license(&self) -> License { match self { Self::Bl1 => License::Demo, Self::Bl1r => License::Demo, Self::Bl1x => License::Demo, Self::Bl1y => License::Demo, Self::Bl2 => License::Demo, Self::Bl2r => License::Demo, Self::Bl2x => License::Demo, Self::Bl2y => License::Demo, Self::Bl3 => License::Demo, Self::Bl3r => License::Demo, Self::Bl3x => License::Demo, Self::Bl3y => License::Demo, Self::Bl4 => License::Demo, Self::Bl4x => License::Demo, Self::So1 => License::S1, Self::So1r => License::S1, Self::So1x => License::S1, Self::So1y => License::S1, Self::So2 => License::S1, Self::So2r => License::S1, Self::So2x => License::S1, Self::So2y => License::S1, Self::So3 => License::S1, Self::So3r => License::S1, Self::So3x => License::S1, Self::So3y => License::S1, Self::So4 => License::S1, Self::So4r => License::S1, Self::So4x => License::S1, Self::So4y => License::S1, Self::So5 => License::S1, Self::So5r => License::S1, Self::So5x => License::S1, Self::So5y => License::S1, Self::So6 => License::S1, Self::So6r => License::S1, Self::So6x => License::S1, Self::So6y => License::S1, Self::Fe1 => License::S1, Self::Fe1r => License::S1, Self::Fe1x => License::S1, Self::Fe1y => License::S1, Self::Fe2 => License::S1, Self::Fe2r => License::S1, Self::Fe2x => License::S1, Self::Fe2y => License::S1, Self::Fe3 => License::S1, Self::Fe3r => License::S1, Self::Fe3x => License::S1, Self::Fe3y => License::S1, Self::Fe4 => License::S1, Self::Fe4r => License::S1, Self::Fe4x => License::S1, Self::Fe4y => License::S1, Self::Fe5 => License::S1, Self::Fe5r => License::S1, Self::Fe5x => License::S1, Self::Fe5y => License::S1, Self::Fe6 => License::S1, Self::Fe6r => License::S1, Self::Fe6x => License::S1, Self::Fe6y => License::S1, Self::Au1 => License::S1, Self::Au1x => License::S1, Self::Au2 => License::S1, Self::Au2x => License::S1, Self::Au3 => License::S1, Self::Au3x => License::S1, Self::Au4 => License::S1, Self::Au4x => License::S1, Self::Ky1 => License::S2, Self::Ky1r => License::S2, Self::Ky1x => License::S2, Self::Ky1y => License::S2, Self::Ky2 => License::S2, Self::Ky2r => License::S2, Self::Ky2x => License::S2, Self::Ky2y => License::S2, Self::Ky3 => License::S2, Self::Ky3r => License::S2, Self::Ky3x => License::S2, Self::Ky3y => License::S2, Self::We1 => License::S2, Self::We1r => License::S2, Self::We1x => License::S2, Self::We1y => License::S2, Self::We2 => License::S2, Self::We2r => License::S2, Self::We2x => License::S2, Self::We2y => License::S2, Self::We3 => License::S2, Self::We3x => License::S2, Self::We4 => License::S2, Self::We4r => License::S2, Self::We4x => License::S2, Self::We4y => License::S2, Self::We5 => License::S2, Self::We5r => License::S2, Self::We5x => License::S2, Self::We5y => License::S2, Self::As1 => License::S2, Self::As1r => License::S2, Self::As1x => License::S2, Self::As1y => License::S2, Self::As2 => License::S2, Self::As2r => License::S2, Self::As2x => License::S2, Self::As2y => License::S2, Self::As3 => License::S2, Self::As3r => License::S2, Self::As3x => License::S2, Self::As3y => License::S2, Self::As4 => License::S2, Self::As4r => License::S2, Self::As4x => License::S2, Self::As4y => License::S2, Self::As5 => License::S2, Self::As5r => License::S2, Self::As5x => License::S2, Self::As5y => License::S2, Self::As6 => License::S2, Self::As6r => License::S2, Self::As6x => License::S2, Self::As6y => License::S2, Self::As7 => License::S2, Self::As7r => License::S2, Self::As7x => License::S2, Self::As7y => License::S2, Self::Ro1 => License::S3, Self::Ro1x => License::S3, Self::Ro2 => License::S3, Self::Ro2x => License::S3, Self::Ro3 => License::S3, Self::Ro3x => License::S3, Self::Ro4 => License::S3, Self::Ro4x => License::S3, Self::Ro5 => License::S3, Self::Ro5x => License::S3, Self::Ro6 => License::S3, Self::Ro6x => License::S3, Self::Ro7 => License::S3, Self::Ro7x => License::S3, Self::Ro8 => License::S3, Self::Ro8x => License::S3, Self::Ro9 => License::S3, Self::Ro9x => License::S3, Self::Ro10 => License::S3, Self::Ro10x => License::S3, Self::Ro11 => License::S3, Self::Ro11x => License::S3, Self::La1 => License::S3, Self::La1x => License::S3, Self::La2 => License::S3, Self::La2x => License::S3, } } /// Driving distance in kilometers pub fn distance_km(&self) -> Option { self.distance_mile().map(|distance| distance * 1.60934) } /// Driving distance in miles pub fn distance_mile(&self) -> Option { match self { Self::Bl1 => Some(2.0), Self::Bl1r => Some(2.0), Self::Bl1x => None, Self::Bl1y => None, Self::Bl2 => Some(2.0), Self::Bl2r => Some(2.0), Self::Bl2x => None, Self::Bl2y => None, Self::Bl3 => Some(2.0), Self::Bl3r => Some(2.0), Self::Bl3x => None, Self::Bl3y => None, Self::Bl4 => None, Self::Bl4x => None, Self::So1 => Some(1.3), Self::So1r => Some(1.3), Self::So1x => None, Self::So1y => None, Self::So2 => Some(1.3), Self::So2r => Some(1.3), Self::So2x => None, Self::So2y => None, Self::So3 => Some(0.8), Self::So3r => Some(0.8), Self::So3x => None, Self::So3y => None, Self::So4 => Some(2.5), Self::So4r => Some(2.5), Self::So4x => None, Self::So4y => None, Self::So5 => Some(2.0), Self::So5r => Some(2.0), Self::So5x => None, Self::So5y => None, Self::So6 => Some(1.8), Self::So6r => Some(1.8), Self::So6x => None, Self::So6y => None, Self::Fe1 => Some(1.0), Self::Fe1r => Some(1.0), Self::Fe1x => None, Self::Fe1y => None, Self::Fe2 => Some(1.9), Self::Fe2r => Some(1.9), Self::Fe2x => None, Self::Fe2y => None, Self::Fe3 => Some(2.2), Self::Fe3r => Some(2.2), Self::Fe3x => None, Self::Fe3y => None, Self::Fe4 => Some(4.1), Self::Fe4r => Some(4.1), Self::Fe4x => None, Self::Fe4y => None, Self::Fe5 => Some(1.3), Self::Fe5r => Some(1.3), Self::Fe5x => None, Self::Fe5y => None, Self::Fe6 => Some(0.5), Self::Fe6r => Some(0.5), Self::Fe6x => None, Self::Fe6y => None, Self::Au1 => None, Self::Au1x => None, Self::Au2 => None, Self::Au2x => None, Self::Au3 => None, Self::Au3x => None, Self::Au4 => None, Self::Au4x => None, Self::Ky1 => Some(1.9), Self::Ky1r => Some(1.9), Self::Ky1x => None, Self::Ky1y => None, Self::Ky2 => Some(3.2), Self::Ky2r => Some(3.2), Self::Ky2x => None, Self::Ky2y => None, Self::Ky3 => Some(4.6), Self::Ky3r => Some(4.6), Self::Ky3x => None, Self::Ky3y => None, Self::We1 => Some(2.7), Self::We1r => Some(2.7), Self::We1x => None, Self::We1y => None, Self::We2 => Some(3.6), Self::We2r => Some(3.6), Self::We2x => None, Self::We2y => None, Self::We3 => None, Self::We3x => None, Self::We4 => Some(0.3), Self::We4r => Some(0.3), Self::We4x => None, Self::We4y => None, Self::We5 => Some(0.8), Self::We5r => Some(0.8), Self::We5x => None, Self::We5y => None, Self::As1 => Some(1.2), Self::As1r => Some(1.2), Self::As1x => None, Self::As1y => None, Self::As2 => Some(1.9), Self::As2r => Some(1.9), Self::As2x => None, Self::As2y => None, Self::As3 => Some(3.5), Self::As3r => Some(3.5), Self::As3x => None, Self::As3y => None, Self::As4 => Some(5.0), Self::As4r => Some(5.0), Self::As4x => None, Self::As4y => None, Self::As5 => Some(5.5), Self::As5r => Some(5.5), Self::As5x => None, Self::As5y => None, Self::As6 => Some(5.0), Self::As6r => Some(5.0), Self::As6x => None, Self::As6y => None, Self::As7 => Some(3.2), Self::As7r => Some(3.2), Self::As7x => None, Self::As7y => None, Self::Ro1 => Some(1.9), Self::Ro1x => None, Self::Ro2 => Some(1.7), Self::Ro2x => None, Self::Ro3 => Some(1.5), Self::Ro3x => None, Self::Ro4 => Some(2.0), Self::Ro4x => None, Self::Ro5 => Some(0.7), Self::Ro5x => None, Self::Ro6 => Some(1.0), Self::Ro6x => None, Self::Ro7 => Some(2.4), Self::Ro7x => None, Self::Ro8 => Some(2.2), Self::Ro8x => None, Self::Ro9 => Some(1.4), Self::Ro9x => None, Self::Ro10 => Some(2.5), Self::Ro10x => None, Self::Ro11 => Some(1.7), Self::Ro11x => None, Self::La1 => None, Self::La1x => None, Self::La2 => None, Self::La2x => None, } } /// Complete name of the track pub fn complete_name(&self) -> String { match self { Self::Bl1 => "Blackwood GP Track", Self::Bl1r => "Blackwood GP Track R", Self::Bl1x => "Blackwood GP Track X", Self::Bl1y => "Blackwood GP Track Y", Self::Bl2 => "Blackwood Historic", Self::Bl2r => "Blackwood Historic R", Self::Bl2x => "Blackwood Historic X", Self::Bl2y => "Blackwood Historic Y", Self::Bl3 => "Blackwood Rallycross", Self::Bl3r => "Blackwood Rallycross R", Self::Bl3x => "Blackwood Rallycross X", Self::Bl3y => "Blackwood Rallycross Y", Self::Bl4 => "Blackwood Carpark", Self::Bl4x => "Blackwood Carpark X", Self::So1 => "South City Classic", Self::So1r => "South City Classic R", Self::So1x => "South City Classic X", Self::So1y => "South City Classic Y", Self::So2 => "South City Sprint 1", Self::So2r => "South City Sprint 1 R", Self::So2x => "South City Sprint 1 X", Self::So2y => "South City Sprint 1 Y", Self::So3 => "South City Sprint 2", Self::So3r => "South City Sprint 2 R", Self::So3x => "South City Sprint 2 X", Self::So3y => "South City Sprint 2 Y", Self::So4 => "South City City Long", Self::So4r => "South City City Long R", Self::So4x => "South City City Long X", Self::So4y => "South City City Long Y", Self::So5 => "South City Town Course", Self::So5r => "South City Town Course R", Self::So5x => "South City Town Course X", Self::So5y => "South City Town Course Y", Self::So6 => "South City Chicane Course", Self::So6r => "South City Chicane Course R", Self::So6x => "South City Chicane Course X", Self::So6y => "South City Chicane Course Y", Self::Fe1 => "Fern Bay Club", Self::Fe1r => "Fern Bay Club R", Self::Fe1x => "Fern Bay Club X", Self::Fe1y => "Fern Bay Club Y", Self::Fe2 => "Fern Bay Green", Self::Fe2r => "Fern Bay Green R", Self::Fe2x => "Fern Bay Green X", Self::Fe2y => "Fern Bay Green Y", Self::Fe3 => "Fern Bay Gold", Self::Fe3r => "Fern Bay Gold R", Self::Fe3x => "Fern Bay Gold X", Self::Fe3y => "Fern Bay Gold Y", Self::Fe4 => "Fern Bay Black", Self::Fe4r => "Fern Bay Black R", Self::Fe4x => "Fern Bay Black X", Self::Fe4y => "Fern Bay Black Y", Self::Fe5 => "Fern Bay Rallycross", Self::Fe5r => "Fern Bay Rallycross R", Self::Fe5x => "Fern Bay Rallycross X", Self::Fe5y => "Fern Bay Rallycross Y", Self::Fe6 => "Fern Bay Rallycross Green", Self::Fe6r => "Fern Bay Rallycross Green R", Self::Fe6x => "Fern Bay Rallycross Green X", Self::Fe6y => "Fern Bay Rallycross Green Y", Self::Au1 => "Autocross", Self::Au1x => "Autocross X", Self::Au2 => "Skid Pad", Self::Au2x => "Skid Pad X", Self::Au3 => "Drag Strip", Self::Au3x => "Drag Strip X", Self::Au4 => "8 Lane Drag Strip", Self::Au4x => "8 Lane Drag Strip X", Self::Ky1 => "Kyoto Oval", Self::Ky1r => "Kyoto Oval R", Self::Ky1x => "Kyoto Oval X", Self::Ky1y => "Kyoto Oval Y", Self::Ky2 => "Kyoto National", Self::Ky2r => "Kyoto National R", Self::Ky2x => "Kyoto National X", Self::Ky2y => "Kyoto National Y", Self::Ky3 => "Kyoto GP Long", Self::Ky3r => "Kyoto GP Long R", Self::Ky3x => "Kyoto GP Long X", Self::Ky3y => "Kyoto GP Long Y", Self::We1 => "Westhill National", Self::We1r => "Westhill National R", Self::We1x => "Westhill National X", Self::We1y => "Westhill National Y", Self::We2 => "Westhill International", Self::We2r => "Westhill International R", Self::We2x => "Westhill International X", Self::We2y => "Westhill International Y", Self::We3 => "Westhill Car Park", Self::We3x => "Westhill Car Park X", Self::We4 => "Westhill Karting", Self::We4r => "Westhill Karting R", Self::We4x => "Westhill Karting X", Self::We4y => "Westhill Karting Y", Self::We5 => "Westhill Karting Long", Self::We5r => "Westhill Karting Long R", Self::We5x => "Westhill Karting Long X", Self::We5y => "Westhill Karting Long Y", Self::As1 => "Aston Cadet", Self::As1r => "Aston Cadet R", Self::As1x => "Aston Cadet X", Self::As1y => "Aston Cadet Y", Self::As2 => "Aston Club", Self::As2r => "Aston Club R", Self::As2x => "Aston Club X", Self::As2y => "Aston Club Y", Self::As3 => "Aston National", Self::As3r => "Aston National R", Self::As3x => "Aston National X", Self::As3y => "Aston National Y", Self::As4 => "Aston Historic", Self::As4r => "Aston Historic R", Self::As4x => "Aston Historic X", Self::As4y => "Aston Historic Y", Self::As5 => "Aston Grand Prix", Self::As5r => "Aston Grand Prix R", Self::As5x => "Aston Grand Prix X", Self::As5y => "Aston Grand Prix Y", Self::As6 => "Aston Grand Touring", Self::As6r => "Aston Grand Touring R", Self::As6x => "Aston Grand Touring X", Self::As6y => "Aston Grand Touring Y", Self::As7 => "Aston North", Self::As7r => "Aston North R", Self::As7x => "Aston North X", Self::As7y => "Aston North Y", Self::Ro1 => "Rockingham ISSC", Self::Ro1x => "Rockingham ISSC X", Self::Ro2 => "Rockingham National", Self::Ro2x => "Rockingham National X", Self::Ro3 => "Rockingham Oval", Self::Ro3x => "Rockingham Oval X", Self::Ro4 => "Rockingham ISSC Long", Self::Ro4x => "Rockingham ISSC Long X", Self::Ro5 => "Rockingham Lake", Self::Ro5x => "Rockingham Lake X", Self::Ro6 => "Rockingham Handling", Self::Ro6x => "Rockingham Handling X", Self::Ro7 => "Rockingham International", Self::Ro7x => "Rockingham International X", Self::Ro8 => "Rockingham Historic", Self::Ro8x => "Rockingham Historic X", Self::Ro9 => "Rockingham Historic Short", Self::Ro9x => "Rockingham Historic Short X", Self::Ro10 => "Rockingham International Long", Self::Ro10x => "Rockingham International Long X", Self::Ro11 => "Rockingham Sportscar", Self::Ro11x => "Rockingham Sportscar X", Self::La1 => "Layout Square Long Grid", Self::La1x => "Layout Square Long Grid X", Self::La2 => "Layout Square Wide Grid", Self::La2x => "Layout Square Wide Grid X", } .to_string() } /// Track short code pub fn code(&self) -> String { match self { Self::Bl1 => "BL1", Self::Bl1r => "BL1R", Self::Bl1x => "BL1X", Self::Bl1y => "BL1Y", Self::Bl2 => "BL2", Self::Bl2r => "BL2R", Self::Bl2x => "BL2X", Self::Bl2y => "BL2Y", Self::Bl3 => "BL3", Self::Bl3r => "BL3R", Self::Bl3x => "BL3X", Self::Bl3y => "BL3Y", Self::Bl4 => "BL4", Self::Bl4x => "BL4X", Self::So1 => "SO1", Self::So1r => "SO1R", Self::So1x => "SO1X", Self::So1y => "SO1Y", Self::So2 => "SO2", Self::So2r => "SO2R", Self::So2x => "SO2X", Self::So2y => "SO2Y", Self::So3 => "SO3", Self::So3r => "SO3R", Self::So3x => "SO3X", Self::So3y => "SO3Y", Self::So4 => "SO4", Self::So4r => "SO4R", Self::So4x => "SO4X", Self::So4y => "SO4Y", Self::So5 => "SO5", Self::So5r => "SO5R", Self::So5x => "SO5X", Self::So5y => "SO5Y", Self::So6 => "SO6", Self::So6r => "SO6R", Self::So6x => "SO6X", Self::So6y => "SO6Y", Self::Fe1 => "FE1", Self::Fe1r => "FE1R", Self::Fe1x => "FE1X", Self::Fe1y => "FE1Y", Self::Fe2 => "FE2", Self::Fe2r => "FE2R", Self::Fe2x => "FE2X", Self::Fe2y => "FE2Y", Self::Fe3 => "FE3", Self::Fe3r => "FE3R", Self::Fe3x => "FE3X", Self::Fe3y => "FE3Y", Self::Fe4 => "FE4", Self::Fe4r => "FE4R", Self::Fe4x => "FE4X", Self::Fe4y => "FE4Y", Self::Fe5 => "FE5", Self::Fe5r => "FE5R", Self::Fe5x => "FE5X", Self::Fe5y => "FE5Y", Self::Fe6 => "FE6", Self::Fe6r => "FE6R", Self::Fe6x => "FE6X", Self::Fe6y => "FE6Y", Self::Au1 => "AU1", Self::Au1x => "AU1X", Self::Au2 => "AU2", Self::Au2x => "AU2X", Self::Au3 => "AU3", Self::Au3x => "AU3X", Self::Au4 => "AU4", Self::Au4x => "AU4X", Self::Ky1 => "KY1", Self::Ky1r => "KY1R", Self::Ky1x => "KY1X", Self::Ky1y => "KY1Y", Self::Ky2 => "KY2", Self::Ky2r => "KY2R", Self::Ky2x => "KY2X", Self::Ky2y => "KY2Y", Self::Ky3 => "KY3", Self::Ky3r => "KY3R", Self::Ky3x => "KY3X", Self::Ky3y => "KY3Y", Self::We1 => "WE1", Self::We1r => "WE1R", Self::We1x => "WE1X", Self::We1y => "WE1Y", Self::We2 => "WE2", Self::We2r => "WE2R", Self::We2x => "WE2X", Self::We2y => "WE2Y", Self::We3 => "WE3", Self::We3x => "WE3X", Self::We4 => "WE4", Self::We4r => "WE4R", Self::We4x => "WE4X", Self::We4y => "WE4Y", Self::We5 => "WE5", Self::We5r => "WE5R", Self::We5x => "WE5X", Self::We5y => "WE5Y", Self::As1 => "AS1", Self::As1r => "AS1R", Self::As1x => "AS1X", Self::As1y => "AS1Y", Self::As2 => "AS2", Self::As2r => "AS2R", Self::As2x => "AS2X", Self::As2y => "AS2Y", Self::As3 => "AS3", Self::As3r => "AS3R", Self::As3x => "AS3X", Self::As3y => "AS3Y", Self::As4 => "AS4", Self::As4r => "AS4R", Self::As4x => "AS4X", Self::As4y => "AS4Y", Self::As5 => "AS5", Self::As5r => "AS5R", Self::As5x => "AS5X", Self::As5y => "AS5Y", Self::As6 => "AS6", Self::As6r => "AS6R", Self::As6x => "AS6X", Self::As6y => "AS6Y", Self::As7 => "AS7", Self::As7r => "AS7R", Self::As7x => "AS7X", Self::As7y => "AS7Y", Self::Ro1 => "RO1", Self::Ro1x => "RO1X", Self::Ro2 => "RO2", Self::Ro2x => "RO2X", Self::Ro3 => "RO3", Self::Ro3x => "RO3X", Self::Ro4 => "RO4", Self::Ro4x => "RO4X", Self::Ro5 => "RO5", Self::Ro5x => "RO5X", Self::Ro6 => "RO6", Self::Ro6x => "RO6X", Self::Ro7 => "RO7", Self::Ro7x => "RO7X", Self::Ro8 => "RO8", Self::Ro8x => "RO8X", Self::Ro9 => "RO9", Self::Ro9x => "RO9X", Self::Ro10 => "RO10", Self::Ro10x => "RO10X", Self::Ro11 => "RO11", Self::Ro11x => "RO11X", Self::La1 => "LA1", Self::La1x => "LA1X", Self::La2 => "LA2", Self::La2x => "LA2X", } .to_string() } /// Is this a reversed track? pub fn is_reverse(&self) -> bool { matches!( self, Self::Bl1r | Self::Bl1y | Self::Bl2r | Self::Bl2y | Self::Bl3r | Self::Bl3y | Self::So1r | Self::So1y | Self::So2r | Self::So2y | Self::So3r | Self::So3y | Self::So4r | Self::So4y | Self::So5r | Self::So5y | Self::So6r | Self::So6y | Self::Fe1r | Self::Fe1y | Self::Fe2r | Self::Fe2y | Self::Fe3r | Self::Fe3y | Self::Fe4r | Self::Fe4y | Self::Fe5r | Self::Fe5y | Self::Fe6r | Self::Fe6y | Self::Ky1r | Self::Ky1y | Self::Ky2r | Self::Ky2y | Self::Ky3r | Self::Ky3y | Self::We1r | Self::We1y | Self::We2r | Self::We2y | Self::We4r | Self::We4y | Self::We5r | Self::We5y | Self::As1r | Self::As1y | Self::As2r | Self::As2y | Self::As3r | Self::As3y | Self::As4r | Self::As4y | Self::As5r | Self::As5y | Self::As6r | Self::As6y | Self::As7r | Self::As7y ) } /// Is this an open world track? pub fn is_open(&self) -> bool { matches!( self, Self::Bl1x | Self::Bl1y | Self::Bl2x | Self::Bl2y | Self::Bl3x | Self::Bl3y | Self::Bl4x | Self::So1x | Self::So1y | Self::So2x | Self::So2y | Self::So3x | Self::So3y | Self::So4x | Self::So4y | Self::So5x | Self::So5y | Self::So6x | Self::So6y | Self::Fe1x | Self::Fe1y | Self::Fe2x | Self::Fe2y | Self::Fe3x | Self::Fe3y | Self::Fe4x | Self::Fe4y | Self::Fe5x | Self::Fe5y | Self::Fe6x | Self::Fe6y | Self::Au1x | Self::Au2x | Self::Au3x | Self::Au4x | Self::Ky1x | Self::Ky1y | Self::Ky2x | Self::Ky2y | Self::Ky3x | Self::Ky3y | Self::We1x | Self::We1y | Self::We2x | Self::We2y | Self::We3x | Self::We4x | Self::We4y | Self::We5x | Self::We5y | Self::As1x | Self::As1y | Self::As2x | Self::As2y | Self::As3x | Self::As3y | Self::As4x | Self::As4y | Self::As5x | Self::As5y | Self::As6x | Self::As6y | Self::As7x | Self::As7y | Self::Ro1x | Self::Ro2x | Self::Ro3x | Self::Ro4x | Self::Ro5x | Self::Ro6x | Self::Ro7x | Self::Ro8x | Self::Ro9x | Self::Ro10x | Self::Ro11x | Self::La1x | Self::La2x ) } } impl BinRead for Track { type Args<'a> = (); fn read_options( reader: &mut R, endian: binrw::Endian, args: Self::Args<'_>, ) -> binrw::BinResult { let pos = reader.stream_position()?; <[u8; 6]>::read_options(reader, endian, args).map(|bytes| match bytes { [b'B', b'L', b'1', 0, 0, 0] => Ok(Self::Bl1), [b'B', b'L', b'1', b'R', 0, 0] => Ok(Self::Bl1r), [b'B', b'L', b'1', b'X', 0, 0] => Ok(Self::Bl1x), [b'B', b'L', b'1', b'Y', 0, 0] => Ok(Self::Bl1y), [b'B', b'L', b'2', 0, 0, 0] => Ok(Self::Bl2), [b'B', b'L', b'2', b'R', 0, 0] => Ok(Self::Bl2r), [b'B', b'L', b'2', b'X', 0, 0] => Ok(Self::Bl2x), [b'B', b'L', b'2', b'Y', 0, 0] => Ok(Self::Bl2y), [b'B', b'L', b'3', 0, 0, 0] => Ok(Self::Bl3), [b'B', b'L', b'3', b'R', 0, 0] => Ok(Self::Bl3r), [b'B', b'L', b'3', b'X', 0, 0] => Ok(Self::Bl3x), [b'B', b'L', b'3', b'Y', 0, 0] => Ok(Self::Bl3y), [b'B', b'L', b'4', 0, 0, 0] => Ok(Self::Bl4), [b'B', b'L', b'4', b'X', 0, 0] => Ok(Self::Bl4x), [b'S', b'O', b'1', 0, 0, 0] => Ok(Self::So1), [b'S', b'O', b'1', b'R', 0, 0] => Ok(Self::So1r), [b'S', b'O', b'1', b'X', 0, 0] => Ok(Self::So1x), [b'S', b'O', b'1', b'Y', 0, 0] => Ok(Self::So1y), [b'S', b'O', b'2', 0, 0, 0] => Ok(Self::So2), [b'S', b'O', b'2', b'R', 0, 0] => Ok(Self::So2r), [b'S', b'O', b'2', b'X', 0, 0] => Ok(Self::So2x), [b'S', b'O', b'2', b'Y', 0, 0] => Ok(Self::So2y), [b'S', b'O', b'3', 0, 0, 0] => Ok(Self::So3), [b'S', b'O', b'3', b'R', 0, 0] => Ok(Self::So3r), [b'S', b'O', b'3', b'X', 0, 0] => Ok(Self::So3x), [b'S', b'O', b'3', b'Y', 0, 0] => Ok(Self::So3y), [b'S', b'O', b'4', 0, 0, 0] => Ok(Self::So4), [b'S', b'O', b'4', b'R', 0, 0] => Ok(Self::So4r), [b'S', b'O', b'4', b'X', 0, 0] => Ok(Self::So4x), [b'S', b'O', b'4', b'Y', 0, 0] => Ok(Self::So4y), [b'S', b'O', b'5', 0, 0, 0] => Ok(Self::So5), [b'S', b'O', b'5', b'R', 0, 0] => Ok(Self::So5r), [b'S', b'O', b'5', b'X', 0, 0] => Ok(Self::So5x), [b'S', b'O', b'5', b'Y', 0, 0] => Ok(Self::So5y), [b'S', b'O', b'6', 0, 0, 0] => Ok(Self::So6), [b'S', b'O', b'6', b'R', 0, 0] => Ok(Self::So6r), [b'S', b'O', b'6', b'X', 0, 0] => Ok(Self::So6x), [b'S', b'O', b'6', b'Y', 0, 0] => Ok(Self::So6y), [b'F', b'E', b'1', 0, 0, 0] => Ok(Self::Fe1), [b'F', b'E', b'1', b'R', 0, 0] => Ok(Self::Fe1r), [b'F', b'E', b'1', b'X', 0, 0] => Ok(Self::Fe1x), [b'F', b'E', b'1', b'Y', 0, 0] => Ok(Self::Fe1y), [b'F', b'E', b'2', 0, 0, 0] => Ok(Self::Fe2), [b'F', b'E', b'2', b'R', 0, 0] => Ok(Self::Fe2r), [b'F', b'E', b'2', b'X', 0, 0] => Ok(Self::Fe2x), [b'F', b'E', b'2', b'Y', 0, 0] => Ok(Self::Fe2y), [b'F', b'E', b'3', 0, 0, 0] => Ok(Self::Fe3), [b'F', b'E', b'3', b'R', 0, 0] => Ok(Self::Fe3r), [b'F', b'E', b'3', b'X', 0, 0] => Ok(Self::Fe3x), [b'F', b'E', b'3', b'Y', 0, 0] => Ok(Self::Fe3y), [b'F', b'E', b'4', 0, 0, 0] => Ok(Self::Fe4), [b'F', b'E', b'4', b'R', 0, 0] => Ok(Self::Fe4r), [b'F', b'E', b'4', b'X', 0, 0] => Ok(Self::Fe4x), [b'F', b'E', b'4', b'Y', 0, 0] => Ok(Self::Fe4y), [b'F', b'E', b'5', 0, 0, 0] => Ok(Self::Fe5), [b'F', b'E', b'5', b'R', 0, 0] => Ok(Self::Fe5r), [b'F', b'E', b'5', b'X', 0, 0] => Ok(Self::Fe5x), [b'F', b'E', b'5', b'Y', 0, 0] => Ok(Self::Fe5y), [b'F', b'E', b'6', 0, 0, 0] => Ok(Self::Fe6), [b'F', b'E', b'6', b'R', 0, 0] => Ok(Self::Fe6r), [b'F', b'E', b'6', b'X', 0, 0] => Ok(Self::Fe6x), [b'F', b'E', b'6', b'Y', 0, 0] => Ok(Self::Fe6y), [b'A', b'U', b'1', 0, 0, 0] => Ok(Self::Au1), [b'A', b'U', b'1', b'X', 0, 0] => Ok(Self::Au1x), [b'A', b'U', b'2', 0, 0, 0] => Ok(Self::Au2), [b'A', b'U', b'2', b'X', 0, 0] => Ok(Self::Au2x), [b'A', b'U', b'3', 0, 0, 0] => Ok(Self::Au3), [b'A', b'U', b'3', b'X', 0, 0] => Ok(Self::Au3x), [b'A', b'U', b'4', 0, 0, 0] => Ok(Self::Au4), [b'A', b'U', b'4', b'X', 0, 0] => Ok(Self::Au4x), [b'K', b'Y', b'1', 0, 0, 0] => Ok(Self::Ky1), [b'K', b'Y', b'1', b'R', 0, 0] => Ok(Self::Ky1r), [b'K', b'Y', b'1', b'X', 0, 0] => Ok(Self::Ky1x), [b'K', b'Y', b'1', b'Y', 0, 0] => Ok(Self::Ky1y), [b'K', b'Y', b'2', 0, 0, 0] => Ok(Self::Ky2), [b'K', b'Y', b'2', b'R', 0, 0] => Ok(Self::Ky2r), [b'K', b'Y', b'2', b'X', 0, 0] => Ok(Self::Ky2x), [b'K', b'Y', b'2', b'Y', 0, 0] => Ok(Self::Ky2y), [b'K', b'Y', b'3', 0, 0, 0] => Ok(Self::Ky3), [b'K', b'Y', b'3', b'R', 0, 0] => Ok(Self::Ky3r), [b'K', b'Y', b'3', b'X', 0, 0] => Ok(Self::Ky3x), [b'K', b'Y', b'3', b'Y', 0, 0] => Ok(Self::Ky3y), [b'W', b'E', b'1', 0, 0, 0] => Ok(Self::We1), [b'W', b'E', b'1', b'R', 0, 0] => Ok(Self::We1r), [b'W', b'E', b'1', b'X', 0, 0] => Ok(Self::We1x), [b'W', b'E', b'1', b'Y', 0, 0] => Ok(Self::We1y), [b'W', b'E', b'2', 0, 0, 0] => Ok(Self::We2), [b'W', b'E', b'2', b'R', 0, 0] => Ok(Self::We2r), [b'W', b'E', b'2', b'X', 0, 0] => Ok(Self::We2x), [b'W', b'E', b'2', b'Y', 0, 0] => Ok(Self::We2y), [b'W', b'E', b'3', 0, 0, 0] => Ok(Self::We3), [b'W', b'E', b'3', b'X', 0, 0] => Ok(Self::We3x), [b'W', b'E', b'4', 0, 0, 0] => Ok(Self::We4), [b'W', b'E', b'4', b'R', 0, 0] => Ok(Self::We4r), [b'W', b'E', b'4', b'X', 0, 0] => Ok(Self::We4x), [b'W', b'E', b'4', b'Y', 0, 0] => Ok(Self::We4y), [b'W', b'E', b'5', 0, 0, 0] => Ok(Self::We5), [b'W', b'E', b'5', b'R', 0, 0] => Ok(Self::We5r), [b'W', b'E', b'5', b'X', 0, 0] => Ok(Self::We5x), [b'W', b'E', b'5', b'Y', 0, 0] => Ok(Self::We5y), [b'A', b'S', b'1', 0, 0, 0] => Ok(Self::As1), [b'A', b'S', b'1', b'R', 0, 0] => Ok(Self::As1r), [b'A', b'S', b'1', b'X', 0, 0] => Ok(Self::As1x), [b'A', b'S', b'1', b'Y', 0, 0] => Ok(Self::As1y), [b'A', b'S', b'2', 0, 0, 0] => Ok(Self::As2), [b'A', b'S', b'2', b'R', 0, 0] => Ok(Self::As2r), [b'A', b'S', b'2', b'X', 0, 0] => Ok(Self::As2x), [b'A', b'S', b'2', b'Y', 0, 0] => Ok(Self::As2y), [b'A', b'S', b'3', 0, 0, 0] => Ok(Self::As3), [b'A', b'S', b'3', b'R', 0, 0] => Ok(Self::As3r), [b'A', b'S', b'3', b'X', 0, 0] => Ok(Self::As3x), [b'A', b'S', b'3', b'Y', 0, 0] => Ok(Self::As3y), [b'A', b'S', b'4', 0, 0, 0] => Ok(Self::As4), [b'A', b'S', b'4', b'R', 0, 0] => Ok(Self::As4r), [b'A', b'S', b'4', b'X', 0, 0] => Ok(Self::As4x), [b'A', b'S', b'4', b'Y', 0, 0] => Ok(Self::As4y), [b'A', b'S', b'5', 0, 0, 0] => Ok(Self::As5), [b'A', b'S', b'5', b'R', 0, 0] => Ok(Self::As5r), [b'A', b'S', b'5', b'X', 0, 0] => Ok(Self::As5x), [b'A', b'S', b'5', b'Y', 0, 0] => Ok(Self::As5y), [b'A', b'S', b'6', 0, 0, 0] => Ok(Self::As6), [b'A', b'S', b'6', b'R', 0, 0] => Ok(Self::As6r), [b'A', b'S', b'6', b'X', 0, 0] => Ok(Self::As6x), [b'A', b'S', b'6', b'Y', 0, 0] => Ok(Self::As6y), [b'A', b'S', b'7', 0, 0, 0] => Ok(Self::As7), [b'A', b'S', b'7', b'R', 0, 0] => Ok(Self::As7r), [b'A', b'S', b'7', b'X', 0, 0] => Ok(Self::As7x), [b'A', b'S', b'7', b'Y', 0, 0] => Ok(Self::As7y), [b'R', b'O', b'1', 0, 0, 0] => Ok(Self::Ro1), [b'R', b'O', b'1', b'X', 0, 0] => Ok(Self::Ro1x), [b'R', b'O', b'2', 0, 0, 0] => Ok(Self::Ro2), [b'R', b'O', b'2', b'X', 0, 0] => Ok(Self::Ro2x), [b'R', b'O', b'3', 0, 0, 0] => Ok(Self::Ro3), [b'R', b'O', b'3', b'X', 0, 0] => Ok(Self::Ro3x), [b'R', b'O', b'4', 0, 0, 0] => Ok(Self::Ro4), [b'R', b'O', b'4', b'X', 0, 0] => Ok(Self::Ro4x), [b'R', b'O', b'5', 0, 0, 0] => Ok(Self::Ro5), [b'R', b'O', b'5', b'X', 0, 0] => Ok(Self::Ro5x), [b'R', b'O', b'6', 0, 0, 0] => Ok(Self::Ro6), [b'R', b'O', b'6', b'X', 0, 0] => Ok(Self::Ro6x), [b'R', b'O', b'7', 0, 0, 0] => Ok(Self::Ro7), [b'R', b'O', b'7', b'X', 0, 0] => Ok(Self::Ro7x), [b'R', b'O', b'8', 0, 0, 0] => Ok(Self::Ro8), [b'R', b'O', b'8', b'X', 0, 0] => Ok(Self::Ro8x), [b'R', b'O', b'9', 0, 0, 0] => Ok(Self::Ro9), [b'R', b'O', b'9', b'X', 0, 0] => Ok(Self::Ro9x), [b'R', b'O', b'1', b'0', 0, 0] => Ok(Self::Ro10), [b'R', b'O', b'1', b'0', b'X', 0] => Ok(Self::Ro10x), [b'R', b'O', b'1', b'1', 0, 0] => Ok(Self::Ro11), [b'R', b'O', b'1', b'1', b'X', 0] => Ok(Self::Ro11x), [b'L', b'A', b'1', 0, 0, 0] => Ok(Self::La1), [b'L', b'A', b'1', b'X', 0, 0] => Ok(Self::La1x), [b'L', b'A', b'2', 0, 0, 0] => Ok(Self::La2), [b'L', b'A', b'2', b'X', 0, 0] => Ok(Self::La2x), _ => Err(binrw::Error::NoVariantMatch { pos }), })? } } impl BinWrite for Track { type Args<'a> = (); fn write_options( &self, writer: &mut W, endian: binrw::Endian, args: Self::Args<'_>, ) -> binrw::BinResult<()> { match self { Self::Bl1 => [b'B', b'L', b'1', 0, 0, 0].write_options(writer, endian, args), Self::Bl1r => [b'B', b'L', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::Bl1x => [b'B', b'L', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::Bl1y => [b'B', b'L', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::Bl2 => [b'B', b'L', b'2', 0, 0, 0].write_options(writer, endian, args), Self::Bl2r => [b'B', b'L', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::Bl2x => [b'B', b'L', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::Bl2y => [b'B', b'L', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::Bl3 => [b'B', b'L', b'3', 0, 0, 0].write_options(writer, endian, args), Self::Bl3r => [b'B', b'L', b'3', b'R', 0, 0].write_options(writer, endian, args), Self::Bl3x => [b'B', b'L', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::Bl3y => [b'B', b'L', b'3', b'Y', 0, 0].write_options(writer, endian, args), Self::Bl4 => [b'B', b'L', b'4', 0, 0, 0].write_options(writer, endian, args), Self::Bl4x => [b'B', b'L', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::So1 => [b'S', b'O', b'1', 0, 0, 0].write_options(writer, endian, args), Self::So1r => [b'S', b'O', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::So1x => [b'S', b'O', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::So1y => [b'S', b'O', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::So2 => [b'S', b'O', b'2', 0, 0, 0].write_options(writer, endian, args), Self::So2r => [b'S', b'O', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::So2x => [b'S', b'O', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::So2y => [b'S', b'O', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::So3 => [b'S', b'O', b'3', 0, 0, 0].write_options(writer, endian, args), Self::So3r => [b'S', b'O', b'3', b'R', 0, 0].write_options(writer, endian, args), Self::So3x => [b'S', b'O', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::So3y => [b'S', b'O', b'3', b'Y', 0, 0].write_options(writer, endian, args), Self::So4 => [b'S', b'O', b'4', 0, 0, 0].write_options(writer, endian, args), Self::So4r => [b'S', b'O', b'4', b'R', 0, 0].write_options(writer, endian, args), Self::So4x => [b'S', b'O', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::So4y => [b'S', b'O', b'4', b'Y', 0, 0].write_options(writer, endian, args), Self::So5 => [b'S', b'O', b'5', 0, 0, 0].write_options(writer, endian, args), Self::So5r => [b'S', b'O', b'5', b'R', 0, 0].write_options(writer, endian, args), Self::So5x => [b'S', b'O', b'5', b'X', 0, 0].write_options(writer, endian, args), Self::So5y => [b'S', b'O', b'5', b'Y', 0, 0].write_options(writer, endian, args), Self::So6 => [b'S', b'O', b'6', 0, 0, 0].write_options(writer, endian, args), Self::So6r => [b'S', b'O', b'6', b'R', 0, 0].write_options(writer, endian, args), Self::So6x => [b'S', b'O', b'6', b'X', 0, 0].write_options(writer, endian, args), Self::So6y => [b'S', b'O', b'6', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe1 => [b'F', b'E', b'1', 0, 0, 0].write_options(writer, endian, args), Self::Fe1r => [b'F', b'E', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::Fe1x => [b'F', b'E', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::Fe1y => [b'F', b'E', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe2 => [b'F', b'E', b'2', 0, 0, 0].write_options(writer, endian, args), Self::Fe2r => [b'F', b'E', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::Fe2x => [b'F', b'E', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::Fe2y => [b'F', b'E', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe3 => [b'F', b'E', b'3', 0, 0, 0].write_options(writer, endian, args), Self::Fe3r => [b'F', b'E', b'3', b'R', 0, 0].write_options(writer, endian, args), Self::Fe3x => [b'F', b'E', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::Fe3y => [b'F', b'E', b'3', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe4 => [b'F', b'E', b'4', 0, 0, 0].write_options(writer, endian, args), Self::Fe4r => [b'F', b'E', b'4', b'R', 0, 0].write_options(writer, endian, args), Self::Fe4x => [b'F', b'E', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::Fe4y => [b'F', b'E', b'4', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe5 => [b'F', b'E', b'5', 0, 0, 0].write_options(writer, endian, args), Self::Fe5r => [b'F', b'E', b'5', b'R', 0, 0].write_options(writer, endian, args), Self::Fe5x => [b'F', b'E', b'5', b'X', 0, 0].write_options(writer, endian, args), Self::Fe5y => [b'F', b'E', b'5', b'Y', 0, 0].write_options(writer, endian, args), Self::Fe6 => [b'F', b'E', b'6', 0, 0, 0].write_options(writer, endian, args), Self::Fe6r => [b'F', b'E', b'6', b'R', 0, 0].write_options(writer, endian, args), Self::Fe6x => [b'F', b'E', b'6', b'X', 0, 0].write_options(writer, endian, args), Self::Fe6y => [b'F', b'E', b'6', b'Y', 0, 0].write_options(writer, endian, args), Self::Au1 => [b'A', b'U', b'1', 0, 0, 0].write_options(writer, endian, args), Self::Au1x => [b'A', b'U', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::Au2 => [b'A', b'U', b'2', 0, 0, 0].write_options(writer, endian, args), Self::Au2x => [b'A', b'U', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::Au3 => [b'A', b'U', b'3', 0, 0, 0].write_options(writer, endian, args), Self::Au3x => [b'A', b'U', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::Au4 => [b'A', b'U', b'4', 0, 0, 0].write_options(writer, endian, args), Self::Au4x => [b'A', b'U', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::Ky1 => [b'K', b'Y', b'1', 0, 0, 0].write_options(writer, endian, args), Self::Ky1r => [b'K', b'Y', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::Ky1x => [b'K', b'Y', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::Ky1y => [b'K', b'Y', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::Ky2 => [b'K', b'Y', b'2', 0, 0, 0].write_options(writer, endian, args), Self::Ky2r => [b'K', b'Y', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::Ky2x => [b'K', b'Y', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::Ky2y => [b'K', b'Y', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::Ky3 => [b'K', b'Y', b'3', 0, 0, 0].write_options(writer, endian, args), Self::Ky3r => [b'K', b'Y', b'3', b'R', 0, 0].write_options(writer, endian, args), Self::Ky3x => [b'K', b'Y', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::Ky3y => [b'K', b'Y', b'3', b'Y', 0, 0].write_options(writer, endian, args), Self::We1 => [b'W', b'E', b'1', 0, 0, 0].write_options(writer, endian, args), Self::We1r => [b'W', b'E', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::We1x => [b'W', b'E', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::We1y => [b'W', b'E', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::We2 => [b'W', b'E', b'2', 0, 0, 0].write_options(writer, endian, args), Self::We2r => [b'W', b'E', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::We2x => [b'W', b'E', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::We2y => [b'W', b'E', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::We3 => [b'W', b'E', b'3', 0, 0, 0].write_options(writer, endian, args), Self::We3x => [b'W', b'E', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::We4 => [b'W', b'E', b'4', 0, 0, 0].write_options(writer, endian, args), Self::We4r => [b'W', b'E', b'4', b'R', 0, 0].write_options(writer, endian, args), Self::We4x => [b'W', b'E', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::We4y => [b'W', b'E', b'4', b'Y', 0, 0].write_options(writer, endian, args), Self::We5 => [b'W', b'E', b'5', 0, 0, 0].write_options(writer, endian, args), Self::We5r => [b'W', b'E', b'5', b'R', 0, 0].write_options(writer, endian, args), Self::We5x => [b'W', b'E', b'5', b'X', 0, 0].write_options(writer, endian, args), Self::We5y => [b'W', b'E', b'5', b'Y', 0, 0].write_options(writer, endian, args), Self::As1 => [b'A', b'S', b'1', 0, 0, 0].write_options(writer, endian, args), Self::As1r => [b'A', b'S', b'1', b'R', 0, 0].write_options(writer, endian, args), Self::As1x => [b'A', b'S', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::As1y => [b'A', b'S', b'1', b'Y', 0, 0].write_options(writer, endian, args), Self::As2 => [b'A', b'S', b'2', 0, 0, 0].write_options(writer, endian, args), Self::As2r => [b'A', b'S', b'2', b'R', 0, 0].write_options(writer, endian, args), Self::As2x => [b'A', b'S', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::As2y => [b'A', b'S', b'2', b'Y', 0, 0].write_options(writer, endian, args), Self::As3 => [b'A', b'S', b'3', 0, 0, 0].write_options(writer, endian, args), Self::As3r => [b'A', b'S', b'3', b'R', 0, 0].write_options(writer, endian, args), Self::As3x => [b'A', b'S', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::As3y => [b'A', b'S', b'3', b'Y', 0, 0].write_options(writer, endian, args), Self::As4 => [b'A', b'S', b'4', 0, 0, 0].write_options(writer, endian, args), Self::As4r => [b'A', b'S', b'4', b'R', 0, 0].write_options(writer, endian, args), Self::As4x => [b'A', b'S', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::As4y => [b'A', b'S', b'4', b'Y', 0, 0].write_options(writer, endian, args), Self::As5 => [b'A', b'S', b'5', 0, 0, 0].write_options(writer, endian, args), Self::As5r => [b'A', b'S', b'5', b'R', 0, 0].write_options(writer, endian, args), Self::As5x => [b'A', b'S', b'5', b'X', 0, 0].write_options(writer, endian, args), Self::As5y => [b'A', b'S', b'5', b'Y', 0, 0].write_options(writer, endian, args), Self::As6 => [b'A', b'S', b'6', 0, 0, 0].write_options(writer, endian, args), Self::As6r => [b'A', b'S', b'6', b'R', 0, 0].write_options(writer, endian, args), Self::As6x => [b'A', b'S', b'6', b'X', 0, 0].write_options(writer, endian, args), Self::As6y => [b'A', b'S', b'6', b'Y', 0, 0].write_options(writer, endian, args), Self::As7 => [b'A', b'S', b'7', 0, 0, 0].write_options(writer, endian, args), Self::As7r => [b'A', b'S', b'7', b'R', 0, 0].write_options(writer, endian, args), Self::As7x => [b'A', b'S', b'7', b'X', 0, 0].write_options(writer, endian, args), Self::As7y => [b'A', b'S', b'7', b'Y', 0, 0].write_options(writer, endian, args), Self::Ro1 => [b'R', b'O', b'1', 0, 0, 0].write_options(writer, endian, args), Self::Ro1x => [b'R', b'O', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::Ro2 => [b'R', b'O', b'2', 0, 0, 0].write_options(writer, endian, args), Self::Ro2x => [b'R', b'O', b'2', b'X', 0, 0].write_options(writer, endian, args), Self::Ro3 => [b'R', b'O', b'3', 0, 0, 0].write_options(writer, endian, args), Self::Ro3x => [b'R', b'O', b'3', b'X', 0, 0].write_options(writer, endian, args), Self::Ro4 => [b'R', b'O', b'4', 0, 0, 0].write_options(writer, endian, args), Self::Ro4x => [b'R', b'O', b'4', b'X', 0, 0].write_options(writer, endian, args), Self::Ro5 => [b'R', b'O', b'5', 0, 0, 0].write_options(writer, endian, args), Self::Ro5x => [b'R', b'O', b'5', b'X', 0, 0].write_options(writer, endian, args), Self::Ro6 => [b'R', b'O', b'6', 0, 0, 0].write_options(writer, endian, args), Self::Ro6x => [b'R', b'O', b'6', b'X', 0, 0].write_options(writer, endian, args), Self::Ro7 => [b'R', b'O', b'7', 0, 0, 0].write_options(writer, endian, args), Self::Ro7x => [b'R', b'O', b'7', b'X', 0, 0].write_options(writer, endian, args), Self::Ro8 => [b'R', b'O', b'8', 0, 0, 0].write_options(writer, endian, args), Self::Ro8x => [b'R', b'O', b'8', b'X', 0, 0].write_options(writer, endian, args), Self::Ro9 => [b'R', b'O', b'9', 0, 0, 0].write_options(writer, endian, args), Self::Ro9x => [b'R', b'O', b'9', b'X', 0, 0].write_options(writer, endian, args), Self::Ro10 => [b'R', b'O', b'1', b'0', 0, 0].write_options(writer, endian, args), Self::Ro10x => [b'R', b'O', b'1', b'0', b'X', 0].write_options(writer, endian, args), Self::Ro11 => [b'R', b'O', b'1', b'1', 0, 0].write_options(writer, endian, args), Self::Ro11x => [b'R', b'O', b'1', b'1', b'X', 0].write_options(writer, endian, args), Self::La1 => [b'L', b'A', b'1', 0, 0, 0].write_options(writer, endian, args), Self::La1x => [b'L', b'A', b'1', b'X', 0, 0].write_options(writer, endian, args), Self::La2 => [b'L', b'A', b'2', 0, 0, 0].write_options(writer, endian, args), Self::La2x => [b'L', b'A', b'2', b'X', 0, 0].write_options(writer, endian, args), } } } impl std::fmt::Display for Track { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "{}", self.code()) } }