//! Endless mode gravity configuration.

use crate::replay::Handling;
use crate::sim::config::{EngineConfig, LeveledGravity, SCORE_ATTACK_LEVEL_TOTALS};

/// Multiplies score-attack thresholds so pressure increases more slowly.
pub const LEVEL_STRETCH: u32 = 5;

pub fn engine_config(handling: Handling, allow_180: bool) -> EngineConfig {
    let thresholds: Vec<u32> = SCORE_ATTACK_LEVEL_TOTALS
        .iter()
        .map(|t| t * LEVEL_STRETCH)
        .collect();
    EngineConfig {
        handling,
        allow_180,
        gravity: Some(LeveledGravity {
            thresholds,
            base: 0.65,
            speed: 0.007,
        }),
        gravity_may20g: true,
    }
}
