Skip to content

Commit

Permalink
feat: update challenge league
Browse files Browse the repository at this point in the history
  • Loading branch information
shonya3 committed Jul 21, 2024
1 parent 9971fcc commit 15ea23f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion googlesheets/src/sheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod tests {
// "range": "science!H5",
// "majorDimension": "ROWS",
// "values": [
// ["league", "Necropolis"],
// ["league", "Settlers"],
// ["date", "11 Sep, 2023"],
// ["total cards", 40000],
// ["total price", 200000],
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ACTIVE_LEAGUE = 'Necropolis';
export const ACTIVE_LEAGUE = 'Settlers';
export const downloadText = (filename: string, text: string = 'empty') => {
const file = new File([text], filename);
const a = document.createElement('a');
Expand Down
10 changes: 5 additions & 5 deletions packages/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export type TablePreferences = {
};

export const leagues = [
'Necropolis',
'Settlers',
'Standard',
'Hardcore Necropolis',
'Hardcore Settlers',
'Hardcore',
'Solo Self-Found',
'SSF Necropolis',
'HC SSF Necropolis',
'SSF Settlers',
'HC SSF Settlers',
] as const;
export const tradeLeagues = ['Necropolis', 'Standard', 'Hardcore Necropolis', 'Hardcore'] as const;
export const tradeLeagues = ['Settlers', 'Standard', 'Hardcore Settlers', 'Hardcore'] as const;
export const permanentLeagues = ['Standard', 'Hardcore', 'Solo Self-Found', 'Hardcore SSF'] as const;

export function isPermanentLeague(league: unknown): league is PermanentLeague | never {
Expand Down
2 changes: 1 addition & 1 deletion packages/wc/src/wc/sample-card/props.json
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,6 @@
},
"filename": "example-2.csv",
"minimumCardPrice": 0,
"league": "Necropolis",
"league": "Settlers",
"selected": false
}
2 changes: 1 addition & 1 deletion playground/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ async fn main() {

// std::fs::write("records.json", &serde_json::to_string(&records).unwrap()).unwrap();

// let p = Prices::fetch(&poe::TradeLeague::Necropolis).await.unwrap();
// let p = Prices::fetch(&poe::TradeLeague::Settlers).await.unwrap();
// println!("{p:#?}");
}
44 changes: 22 additions & 22 deletions poe/src/league.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ pub enum League {
#[serde(alias = "SSF Hardcore", alias = "Hardcore SSF")]
SSFHardcore,
#[default]
Necropolis,
#[serde(alias = "Hardcore Necropolis")]
HardcoreNecropolis,
#[serde(alias = "SSF Necropolis")]
SSFNecropolis,
#[serde(alias = "HC SSF Necropolis")]
SSFHCNecropolis,
Settlers,
#[serde(alias = "Hardcore Settlers")]
HardcoreSettlers,
#[serde(alias = "SSF Settlers")]
SSFSettlers,
#[serde(alias = "HC SSF Settlers")]
SSFHCSettlers,
#[serde(untagged)]
Custom(String),
}
Expand All @@ -34,10 +34,10 @@ impl Display for League {
League::Hardcore => write!(f, "Hardcore"),
League::SSFStandard => write!(f, "Solo Self-Found"),
League::SSFHardcore => write!(f, "Hardcore SSF"),
League::Necropolis => write!(f, "Necropolis"),
League::HardcoreNecropolis => write!(f, "Hardcore Necropolis"),
League::SSFNecropolis => write!(f, "SSF Necropolis"),
League::SSFHCNecropolis => write!(f, "HC SSF Necropolis"),
League::Settlers => write!(f, "Settlers"),
League::HardcoreSettlers => write!(f, "Hardcore Settlers"),
League::SSFSettlers => write!(f, "SSF Settlers"),
League::SSFHCSettlers => write!(f, "HC SSF Settlers"),
League::Custom(league) => write!(f, "{}", league),
}
}
Expand All @@ -48,8 +48,8 @@ impl From<TradeLeague> for League {
match value {
TradeLeague::Standard => League::Standard,
TradeLeague::Hardcore => League::Hardcore,
TradeLeague::Necropolis => League::Necropolis,
TradeLeague::HardcoreNecropolis => League::HardcoreNecropolis,
TradeLeague::Settlers => League::Settlers,
TradeLeague::HardcoreSettlers => League::HardcoreSettlers,
}
}
}
Expand All @@ -59,18 +59,18 @@ pub enum TradeLeague {
Standard,
Hardcore,
#[default]
Necropolis,
#[serde(alias = "Hardcore Necropolis", rename = "Hardcore Necropolis")]
HardcoreNecropolis,
Settlers,
#[serde(alias = "Hardcore Settlers", rename = "Hardcore Settlers")]
HardcoreSettlers,
}

impl Display for TradeLeague {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TradeLeague::Standard => write!(f, "Standard"),
TradeLeague::Hardcore => write!(f, "Hardcore"),
TradeLeague::Necropolis => write!(f, "Necropolis"),
TradeLeague::HardcoreNecropolis => write!(f, "Hardcore Necropolis"),
TradeLeague::Settlers => write!(f, "Settlers"),
TradeLeague::HardcoreSettlers => write!(f, "Hardcore Settlers"),
}
}
}
Expand All @@ -86,10 +86,10 @@ impl TryFrom<League> for TradeLeague {
League::Hardcore => Ok(TradeLeague::Hardcore),
League::SSFStandard => Err(msg),
League::SSFHardcore => Err(msg),
League::Necropolis => Ok(TradeLeague::Necropolis),
League::HardcoreNecropolis => Ok(TradeLeague::HardcoreNecropolis),
League::SSFNecropolis => Err(msg),
League::SSFHCNecropolis => Err(msg),
League::Settlers => Ok(TradeLeague::Settlers),
League::HardcoreSettlers => Ok(TradeLeague::HardcoreSettlers),
League::SSFSettlers => Err(msg),
League::SSFHCSettlers => Err(msg),
League::Custom(_) => Err(msg),
}
}
Expand Down

0 comments on commit 15ea23f

Please sign in to comment.