Ethics & Phenotype Endpoints + Phenotype Renaming
This commit is contained in:
parent
d91af52811
commit
097b6884b9
7 changed files with 163 additions and 41 deletions
src/v3
|
@ -1,4 +1,4 @@
|
|||
use std::{collections::HashMap};
|
||||
use std::{collections::HashMap, hash::Hash};
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
use utoipa::{ToSchema, IntoParams};
|
||||
|
@ -43,7 +43,7 @@ pub struct DeleteGameParam {
|
|||
pub struct FullViewData {
|
||||
pub games: HashMap<i32, ChellarisGameLegacy>,
|
||||
pub ethics: HashMap<i32, Ethic>,
|
||||
pub species: HashMap<i32, Species>,
|
||||
pub phenotypes: HashMap<i32, Phenotype>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
|
@ -213,11 +213,13 @@ pub struct ChellarisEmpireLegacy {
|
|||
pub ethics: HashMap<i32, EmpireEthicLegacy>,
|
||||
}
|
||||
|
||||
// Ethics Structs
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Ethic {
|
||||
pub id: i32,
|
||||
pub display: String,
|
||||
pub machine: bool,
|
||||
pub gestalt: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ToSchema, Debug, Clone)]
|
||||
|
@ -232,21 +234,33 @@ pub struct EmpireEthic {
|
|||
pub struct EmpireEthicLegacy {
|
||||
pub ethic_id: i32,
|
||||
pub display: String,
|
||||
pub machine: bool,
|
||||
pub gestalt: bool,
|
||||
pub fanatic: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct ChellarisEthics {
|
||||
pub ethics: HashMap<i32, Ethic>,
|
||||
}
|
||||
|
||||
// Species Structs
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Phenotype {
|
||||
pub id: i32,
|
||||
pub display: String,
|
||||
pub species: HashMap<i32, Species>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct ChellarisPhenotypes {
|
||||
pub phenotypes: HashMap<i32, Phenotype>
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Species {
|
||||
pub id: i32,
|
||||
pub display: String,
|
||||
pub portraits: HashMap<i32, Portrait>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema, Debug, Clone)]
|
||||
pub struct Portrait {
|
||||
pub id: i32,
|
||||
pub hires: String,
|
||||
pub lores: Option<String>,
|
||||
pub lores: String,
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue