updated elim teams
This commit is contained in:
parent
24abe5aa39
commit
19243162f7
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "0.5.26"
|
version = "0.5.27"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Pyrit [2111649]"]
|
authors = ["Pyrit [2111649]"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -46,9 +46,9 @@ pub struct EliminationLeaderboard {
|
||||||
pub team: user::EliminationTeam,
|
pub team: user::EliminationTeam,
|
||||||
pub score: i16,
|
pub score: i16,
|
||||||
pub lives: i16,
|
pub lives: i16,
|
||||||
pub participants: i16,
|
pub participants: Option<i16>,
|
||||||
pub wins: i32,
|
pub wins: Option<i32>,
|
||||||
pub losses: i32,
|
pub losses: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -171,6 +171,7 @@ pub struct TerritoryWarReportTerritory {
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum TerritoryWarOutcome {
|
pub enum TerritoryWarOutcome {
|
||||||
EndWithPeaceTreaty,
|
EndWithPeaceTreaty,
|
||||||
|
EndWithDestroyDefense,
|
||||||
FailAssault,
|
FailAssault,
|
||||||
SuccessAssault,
|
SuccessAssault,
|
||||||
}
|
}
|
||||||
|
@ -298,5 +299,16 @@ mod tests {
|
||||||
response.territory_war_report().unwrap().war.result,
|
response.territory_war_report().unwrap().war.result,
|
||||||
TerritoryWarOutcome::EndWithPeaceTreaty
|
TerritoryWarOutcome::EndWithPeaceTreaty
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let response = Client::default()
|
||||||
|
.torn_api(&key)
|
||||||
|
.torn(|b| b.selections(&[Selection::TerritoryWarReport]).id(23757))
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
response.territory_war_report().unwrap().war.result,
|
||||||
|
TerritoryWarOutcome::EndWithDestroyDefense
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ pub struct LifeBar {
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Deserialize)]
|
#[derive(Debug, Clone, Copy, Deserialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub enum EliminationTeam {
|
pub enum EliminationTeam2022 {
|
||||||
Firestarters,
|
Firestarters,
|
||||||
HardBoiled,
|
HardBoiled,
|
||||||
QuackAddicts,
|
QuackAddicts,
|
||||||
|
@ -175,6 +175,19 @@ pub enum EliminationTeam {
|
||||||
Sleepyheads,
|
Sleepyheads,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, Deserialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
|
pub enum EliminationTeam {
|
||||||
|
Backstabbers,
|
||||||
|
Cheese,
|
||||||
|
DeathsDoor,
|
||||||
|
RegularHumanPeople,
|
||||||
|
FlowerRangers,
|
||||||
|
ReligiousExtremists,
|
||||||
|
Hivemind,
|
||||||
|
CapsLockCrew,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Competition {
|
pub enum Competition {
|
||||||
Elimination {
|
Elimination {
|
||||||
|
@ -268,35 +281,15 @@ where
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(match team_raw {
|
Some(match team_raw {
|
||||||
"firestarters" => EliminationTeam::Firestarters,
|
"backstabbers" => EliminationTeam::Backstabbers,
|
||||||
"hard-boiled" => EliminationTeam::HardBoiled,
|
"cheese" => EliminationTeam::Cheese,
|
||||||
"quack-addicts" => EliminationTeam::QuackAddicts,
|
"deaths-door" => EliminationTeam::DeathsDoor,
|
||||||
"rain-men" => EliminationTeam::RainMen,
|
"regular-human-people" => EliminationTeam::RegularHumanPeople,
|
||||||
"totally-boned" => EliminationTeam::TotallyBoned,
|
"flower-rangers" => EliminationTeam::FlowerRangers,
|
||||||
"rawring-thunder" => EliminationTeam::RawringThunder,
|
"religious-extremists" => EliminationTeam::ReligiousExtremists,
|
||||||
"dirty-cops" => EliminationTeam::DirtyCops,
|
"hivemind" => EliminationTeam::Hivemind,
|
||||||
"laughing-stock" => EliminationTeam::LaughingStock,
|
"caps-lock-crew" => EliminationTeam::CapsLockCrew,
|
||||||
"jean-therapy" => EliminationTeam::JeanTherapy,
|
_ => Err(de::Error::unknown_variant(team_raw, &[]))?,
|
||||||
"satants-soldiers" => EliminationTeam::SatansSoldiers,
|
|
||||||
"wolf-pack" => EliminationTeam::WolfPack,
|
|
||||||
"sleepyheads" => EliminationTeam::Sleepyheads,
|
|
||||||
_ => Err(de::Error::unknown_variant(
|
|
||||||
team_raw,
|
|
||||||
&[
|
|
||||||
"firestarters",
|
|
||||||
"hard-boiled",
|
|
||||||
"quack-addicts",
|
|
||||||
"rain-men",
|
|
||||||
"totally-boned",
|
|
||||||
"rawring-thunder",
|
|
||||||
"dirty-cops",
|
|
||||||
"laughing-stock",
|
|
||||||
"jean-therapy",
|
|
||||||
"satants-soldiers",
|
|
||||||
"wolf-pack",
|
|
||||||
"sleepyheads",
|
|
||||||
],
|
|
||||||
))?,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue