~starkingdoms/starkingdoms

ref: 39d56abc48b6f649328ab5ea7c0adeace42c3b35 starkingdoms/crates/unified/src/config/world.rs -rw-r--r-- 876 bytes
39d56abc — core feat: pain, suffering, and despair 16 days ago
                                                                                
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
use bevy::asset::Asset;
use crate::prelude::*;
use serde::Deserialize;

#[derive(Deserialize, Asset, TypePath, Clone)]
pub struct GlobalWorldConfig {
    pub world: WorldConfig,
    pub part: WPartConfig,
    pub hearty: HeartyConfig
}

#[derive(Deserialize, Asset, TypePath, Clone)]
pub struct WorldConfig {
    pub gravity: f64,
    pub gravity_iterations: usize,
    pub spawn_parts_at: String,
    pub spawn_parts_interval_secs: f32,
}

#[derive(Deserialize, Asset, TypePath, Clone, Debug)]
pub struct WPartConfig {
    pub default_width: f64,
    pub default_height: f64,
    pub default_mass: f64,
    pub joint_point_compliance: f64,
    pub joint_angle_compliance: f64,
    pub joint_distance_damping: f64,
    pub joint_angular_damping: f64,
}

#[derive(Deserialize, Asset, TypePath, Clone)]
pub struct HeartyConfig {
    pub thrust: f32,
    pub spawn_at: String,
}