Add EMERALD tier

pull/56/head
Mingwei Samuel 2023-07-21 00:48:22 -07:00
parent 908d0d64ed
commit 07a96f5fa9
2 changed files with 10 additions and 5 deletions

View File

@ -90,12 +90,12 @@ mod tests {
assert_eq!(Some((Tier::DIAMOND, Division::II)), it.next());
assert_eq!(Some((Tier::DIAMOND, Division::III)), it.next());
assert_eq!(Some((Tier::DIAMOND, Division::IV)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::I)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::II)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::III)), it.next());
assert_eq!(Some((Tier::EMERALD, Division::IV)), it.next());
assert_eq!(Some((Tier::PLATINUM, Division::I)), it.next());
let mut last = None;
for next in &mut it {
last = Some(next);
}
let last = it.last();
assert_eq!(Some((Tier::IRON, Division::IV)), last);
assert_eq!(None, it.next());
}
}

View File

@ -38,6 +38,8 @@ pub enum Tier {
MASTER = 180,
/// Diamond, the higest non-apex tier. Repr: `140_u8`.
DIAMOND = 140,
/// Emerald. Added in 2023. Repr: `130_u8`.
EMERALD = 130,
/// Platinum. Repr: `120_u8`.
PLATINUM = 120,
/// Gold. Repr: `100_u8`.
@ -109,6 +111,7 @@ impl IntoEnumIterator for Tier {
Self::GRANDMASTER,
Self::MASTER,
Self::DIAMOND,
Self::EMERALD,
Self::PLATINUM,
Self::GOLD,
Self::SILVER,
@ -188,6 +191,7 @@ mod tests {
iter.next();
iter.next();
assert_eq!(Some(Tier::DIAMOND), iter.next());
assert_eq!(Some(Tier::EMERALD), iter.next());
iter.next();
iter.next();
iter.next();
@ -202,6 +206,7 @@ mod tests {
iter.next();
iter.next();
iter.next();
assert_eq!(Some(Tier::EMERALD), iter.next());
assert_eq!(Some(Tier::DIAMOND), iter.next());
iter.next();
iter.next();