1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use super::common::Yields;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BaseTerrainInfo {
pub name: String,
pub r#type: String,
#[serde(flatten)]
pub yields: Yields,
#[serde(default)]
pub movement_cost: u32,
#[serde(rename = "RGB")]
#[serde(default)]
pub rgb: [u8; 3],
/// Latitude range for base terrain placement, where the first element is the minimum
/// latitude and the second element is the maximum latitude.
///
/// The interval type is dynamically determined by the boundary values:
/// - `[0.0, 0.0]`: Valid only at the equator.
/// - `[a, 1.0]`: A closed interval valid for `a <= latitude <= 1.0`.
/// - e.g. `[0.0, 1.0]` means that base terrain can be placed anywhere.
/// - Other `[a, b]`: A half-open interval valid for `a <= latitude < b`.
/// This applies when `a != 0.0` and `b` is neither `0.0` nor `1.0`.
///
/// # Notes
///
/// The `latitude` range is affected by the `temperature` parameter in [`crate::map_parameters::MapParameters`].
/// The default value loaded from the JSON file corresponds to the [`Temperature::Normal`](crate::map_parameters::Temperature::Normal) setting.
/// See the [`crate::TileMap::generate_base_terrains`] method for more details.
latitude: [f64; 2],
#[serde(default)]
pub uniques: Vec<String>,
#[serde(default)]
pub civilopedia_text: Vec<HashMap<String, String>>,
}