ddapi_rs/scheme/ddnet/
releases_maps.rs1use crate::scheme::DDNET_BASE_URL;
2use serde_derive::{Deserialize, Serialize};
3
4#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct ReleasesMaps {
6 pub name: String,
7 pub website: String,
8 pub thumbnail: String,
9 pub web_preview: String,
10 pub r#type: String,
11 pub points: u8,
12 pub difficulty: u8,
13 pub mapper: String,
14 pub release: String,
15 pub width: Option<u64>,
16 pub height: Option<u64>,
17 #[serde(default)]
18 pub tiles: Vec<String>,
19}
20
21impl ReleasesMaps {
22 pub fn url() -> String {
23 format!("https://{}/releases", DDNET_BASE_URL)
24 }
25
26 pub fn api() -> String {
27 format!("https://{}/releases/maps.json", DDNET_BASE_URL)
28 }
29}