-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented displays and split up modules
- Loading branch information
Showing
7 changed files
with
278 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use serde::Deserialize; | ||
use std::fmt::{self, Display, Formatter}; | ||
|
||
/// The queue mode. | ||
#[derive(Deserialize, Copy, Clone, Debug, PartialEq, Eq, Hash)] | ||
#[serde(rename_all = "snake_case")] | ||
#[non_exhaustive] | ||
pub enum QueueMode { | ||
/// Casual Queue | ||
Casual, | ||
/// Ranked Queue | ||
Ranked, | ||
/// Unranked Queue and other | ||
Other, | ||
} | ||
|
||
impl Display for QueueMode { | ||
fn fmt(&self, f: &mut Formatter) -> fmt::Result { | ||
match self { | ||
Self::Casual => write!(f, "Casual"), | ||
Self::Ranked => write!(f, "Ranked"), | ||
Self::Other => write!(f, "Other"), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use serde_repr::Deserialize_repr; | ||
use std::fmt::{self, Display, Formatter}; | ||
|
||
/// The match result. | ||
#[derive(Deserialize_repr, Copy, Clone, Debug)] | ||
#[repr(u8)] | ||
pub enum MatchResult { | ||
NotAvailable = 0, | ||
Win = 1, | ||
Loss = 2, | ||
Abandoned = 3, | ||
} | ||
|
||
impl Display for MatchResult { | ||
fn fmt(&self, f: &mut Formatter) -> fmt::Result { | ||
match self { | ||
Self::NotAvailable => write!(f, "Not Available"), | ||
Self::Win => write!(f, "Win"), | ||
Self::Loss => write!(f, "Loss"), | ||
Self::Abandoned => write!(f, "Abandoned"), | ||
} | ||
} | ||
} |
Oops, something went wrong.