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>>();
let slots = vec![
Role::Tank,
Role::DPS,
Role::DPS,
Role::Dps,
Role::Dps,
Role::Support,
Role::Support,
];

View File

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

View File

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

View File

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

View File

@@ -30,7 +30,7 @@ fn get_role_entries(
let (tanks, rest) = entries
.into_iter()
.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)
}
@@ -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 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 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),
),
(
Role::DPS,
Role::Dps,
Rating::new(model.dps_rating, model.dps_rd, model.dps_volatility),
),
(