pub fn is_valid_game_mode(queue_id: i64) -> boolExpand description
⚙️ Function: Checks if a given queue ID corresponds to a valid game mode.
This function verifies if the provided queue_id matches any valid game modes listed in the QUEUE_ID_MAP.
The QUEUE_ID_MAP contains a predefined set of game modes such as ranked, normal, and ARAM.
§Parameters:
queue_id: The ID of the game queue (e.g., Ranked Solo/Duo, ARAM) to validate.
§Returns:
bool: Returnstrueif thequeue_idmatches a valid game mode inQUEUE_ID_MAP, otherwise returnsfalse.
§⚠️ Notes:
QUEUE_ID_MAPcontains predefined game modes, so any queue ID not included in this map will returnfalse.- This function is useful for filtering out game modes that aren’t relevant or valid for certain statistics (e.g., custom games).
§Example:
let is_valid = is_valid_game_mode(420); // Ranked Solo/Duo
if is_valid {
println!("This is a valid game mode.");
}If queue_id is valid, such as 420 for Ranked Solo/Duo, the result will be:
true