From 259f09aef5d09c69589dee2bcb2ec54d850a8183 Mon Sep 17 00:00:00 2001 From: TotallyNot <44345987+TotallyNot@users.noreply.github.com> Date: Fri, 9 Sep 2022 23:27:49 +0200 Subject: [PATCH] added user->crimes --- torn-api/Cargo.toml | 2 +- torn-api/src/user.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index c71e2cf..4c53fbf 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "0.4.0" +version = "0.4.1" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" diff --git a/torn-api/src/user.rs b/torn-api/src/user.rs index 88b7ec5..84f6be3 100644 --- a/torn-api/src/user.rs +++ b/torn-api/src/user.rs @@ -19,6 +19,8 @@ pub enum Selection { Discord, #[api(type = "PersonalStats", field = "personalstats")] PersonalStats, + #[api(type = "CriminalRecord", field = "criminalrecord")] + Crimes, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)] @@ -371,6 +373,19 @@ pub struct PersonalStats { pub best_damage: i32, } +#[derive(Deserialize)] +pub struct CriminalRecord { + pub selling_illegal_products: i32, + pub theft: i32, + pub auto_theft: i32, + pub drug_deals: i32, + pub computer_crimes: i32, + pub murder: i32, + pub fraud_crimes: i32, + pub other: i32, + pub total: i32, +} + #[cfg(test)] mod tests { use super::*; @@ -388,6 +403,7 @@ mod tests { Selection::Discord, Selection::Profile, Selection::PersonalStats, + Selection::Crimes, ]) }) .await