mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
Adding QueueType enum
This commit is contained in:
parent
57a37b5a0f
commit
42c6801453
2 changed files with 32 additions and 1 deletions
|
@ -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
28
src/consts/queue_type.rs
Normal 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])
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue