rename DPS to Dps

This commit is contained in:
Lionarius
2023-04-22 19:19:42 +03:00
parent a4471d703b
commit c34bc3c11e
6 changed files with 12 additions and 12 deletions

View File

@@ -267,8 +267,8 @@ impl LobbyCommand {
.collect::<Vec<Player>>(); .collect::<Vec<Player>>();
let slots = vec![ let slots = vec![
Role::Tank, Role::Tank,
Role::DPS, Role::Dps,
Role::DPS, Role::Dps,
Role::Support, Role::Support,
Role::Support, Role::Support,
]; ];

View File

@@ -79,8 +79,8 @@ impl SettingsCommand {
let roles: HashMap<_, _, RandomState> = HashMap::from_iter( let roles: HashMap<_, _, RandomState> = HashMap::from_iter(
[ [
("support", Role::Support), ("support", Role::Support),
("damage", Role::DPS), ("damage", Role::Dps),
("dps", Role::DPS), ("dps", Role::Dps),
("tank", Role::Tank), ("tank", Role::Tank),
] ]
.into_iter(), .into_iter(),

View File

@@ -6,7 +6,7 @@ pub enum Role {
#[sea_orm(string_value = "tank")] #[sea_orm(string_value = "tank")]
Tank, Tank,
#[sea_orm(string_value = "dps")] #[sea_orm(string_value = "dps")]
DPS, Dps,
#[sea_orm(string_value = "support")] #[sea_orm(string_value = "support")]
Support, Support,
} }
@@ -15,7 +15,7 @@ impl From<Role> for String {
fn from(role: Role) -> Self { fn from(role: Role) -> Self {
match role { match role {
Role::Tank => "tank".to_string(), Role::Tank => "tank".to_string(),
Role::DPS => "dps".to_string(), Role::Dps => "dps".to_string(),
Role::Support => "support".to_string(), Role::Support => "support".to_string(),
} }
} }
@@ -27,7 +27,7 @@ impl TryFrom<&str> for Role {
fn try_from(role: &str) -> Result<Self, Self::Error> { fn try_from(role: &str) -> Result<Self, Self::Error> {
match role { match role {
"tank" => Ok(Role::Tank), "tank" => Ok(Role::Tank),
"dps" => Ok(Role::DPS), "dps" => Ok(Role::Dps),
"support" => Ok(Role::Support), "support" => Ok(Role::Support),
_ => Err(()), _ => Err(()),
} }
@@ -38,7 +38,7 @@ impl From<Role> for i32 {
fn from(role: Role) -> Self { fn from(role: Role) -> Self {
match role { match role {
Role::Tank => 0, Role::Tank => 0,
Role::DPS => 1, Role::Dps => 1,
Role::Support => 2, Role::Support => 2,
} }
} }

View File

@@ -73,7 +73,7 @@ impl Query {
player.tank_rd = Set(rating.rd); player.tank_rd = Set(rating.rd);
player.tank_volatility = Set(rating.volatility); player.tank_volatility = Set(rating.volatility);
} }
Role::DPS => { Role::Dps => {
player.dps_rating = Set(rating.value); player.dps_rating = Set(rating.value);
player.dps_rd = Set(rating.rd); player.dps_rd = Set(rating.rd);
player.dps_volatility = Set(rating.volatility); player.dps_volatility = Set(rating.volatility);

View File

@@ -30,7 +30,7 @@ fn get_role_entries(
let (tanks, rest) = entries let (tanks, rest) = entries
.into_iter() .into_iter()
.partition::<Vec<_>, _>(|e| e.role == Role::Tank); .partition::<Vec<_>, _>(|e| e.role == Role::Tank);
let (dps, supports) = rest.into_iter().partition(|e| e.role == Role::DPS); let (dps, supports) = rest.into_iter().partition(|e| e.role == Role::Dps);
(tanks, dps, supports) (tanks, dps, supports)
} }
@@ -55,7 +55,7 @@ pub fn mix_players(players: &[Player], slots: Vec<Role>) -> Option<(Team, Team)>
let tank_count = slots.iter().filter(|r| **r == Role::Tank).count(); let tank_count = slots.iter().filter(|r| **r == Role::Tank).count();
let support_count = slots.iter().filter(|r| **r == Role::Support).count(); let support_count = slots.iter().filter(|r| **r == Role::Support).count();
let dps_count = slots.iter().filter(|r| **r == Role::DPS).count(); let dps_count = slots.iter().filter(|r| **r == Role::Dps).count();
let tank_combos = get_combinations(&tanks, tank_count); let tank_combos = get_combinations(&tanks, tank_count);
let dps_combos = get_combinations(&dps, dps_count); let dps_combos = get_combinations(&dps, dps_count);

View File

@@ -36,7 +36,7 @@ impl Player {
Rating::new(model.tank_rating, model.tank_rd, model.tank_volatility), Rating::new(model.tank_rating, model.tank_rd, model.tank_volatility),
), ),
( (
Role::DPS, Role::Dps,
Rating::new(model.dps_rating, model.dps_rd, model.dps_volatility), Rating::new(model.dps_rating, model.dps_rd, model.dps_volatility),
), ),
( (