Adding QueueType enum

This commit is contained in:
Mingwei Samuel 2019-10-25 12:44:45 -07:00
parent 57a37b5a0f
commit 42c6801453
2 changed files with 32 additions and 1 deletions

View file

@ -12,5 +12,8 @@ pub use season::*;
mod queue;
pub use queue::*;
mod queue_type;
pub use queue_type::*;
mod team;
pub use team::*;
pub use team::*;

28
src/consts/queue_type.rs Normal file
View file

@ -0,0 +1,28 @@
use std::fmt;
#[derive(fmt::Debug, Copy, Clone)]
pub enum QueueType {
// League of Legends, Summoner's Rift (5v5), Ranked Solo Queue.
RankedSolo5x5,
// League of Legends, Summoner's Rift (5v5), Flex Queue.
RankedFlexSr,
// League of Legends, Twisted Treeline (3v3), Flex Queue.
RankedFlexTt,
// Ranked Teamfight Tactics.
RankedTft,
}
impl QueueType {
const NAMES: [&'static str; 4] = [
"RANKED_SOLO_5x5",
"RANKED_FLEX_SR",
"RANKED_FLEX_TT",
"RANKED_TFT",
];
}
impl fmt::Display for QueueType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::NAMES[*self as usize])
}
}