Function is_valid_game_mode

Source
pub fn is_valid_game_mode(queue_id: i64) -> bool
Expand 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: Returns true if the queue_id matches a valid game mode in QUEUE_ID_MAP, otherwise returns false.

§⚠️ Notes:

  • QUEUE_ID_MAP contains predefined game modes, so any queue ID not included in this map will return false.
  • 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