forked from mirror/Riven
1
0
Fork 0

Add RANKED_TFT_DOUBLE_UP (renamed version of RANKED_TFT_PAIRS)

users/mingwei/unknown-variant-messy
Mingwei Samuel 2022-06-15 15:10:04 -07:00
parent 056bacf67c
commit b82a1725c1
2 changed files with 14 additions and 3 deletions

View File

@ -3,11 +3,15 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// LoL or TFT ranked queue types.
#[non_exhaustive]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Clone)]
#[derive(Eq, PartialEq, Hash)]
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)]
#[derive(Serialize, Deserialize)]
pub enum QueueType {
/// Catch-all variant for new, unknown queue types.
#[strum(default)]
UNKNOWN(String),
/// League of Legends, Summoner's Rift (5v5), Ranked Solo Queue.
RANKED_SOLO_5x5,
/// League of Legends, Summoner's Rift (5v5), Flex Queue.
@ -19,7 +23,11 @@ pub enum QueueType {
/// Ranked Teamfight Tactics, Hyper Roll gamemode.
RANKED_TFT_TURBO,
/// Ranked Teamfight Tactics, Double Up gamemode.
RANKED_TFT_PAIRS
RANKED_TFT_DOUBLE_UP,
/// Ranked Teamfight Tactics, OLD Double Up gamemode. Changed some time before June 2022.
#[deprecated(note="Use RANKED_TFT_DOUBLE_UP instead.")]
RANKED_TFT_PAIRS,
}
#[cfg(test)]

View File

@ -54,7 +54,10 @@ async_tests!{
let league_fut = RIOT_API.league_v4().get_league_entries_for_summoner(ROUTE, &*summoner.id);
let league = league_fut.await.map_err(|e| e.to_string())?;
rassert_eq!(1, league.len()); // BRITTLE!
rassert_eq!(league[0].queue_type, QueueType::RANKED_TFT_PAIRS);
#[allow(deprecated)]
{
rassert_eq!(league[0].queue_type, QueueType::RANKED_TFT_PAIRS);
}
Ok(())
},