Skip to main content

lighty_launch/launch/
config.rs

1// Copyright (c) 2025 Hamadi
2// Licensed under the MIT License
3
4//! Global launch configuration shared across all launches.
5
6use lighty_java::JavaDistribution;
7
8/// Launch configuration shared across launches.
9#[derive(Debug, Clone)]
10pub struct LaunchConfig {
11    pub username: String,
12    pub uuid: String,
13    pub java_distribution: JavaDistribution,
14}
15
16impl LaunchConfig {
17    /// Create a new launch configuration.
18    pub fn new(
19        username: impl Into<String>,
20        uuid: impl Into<String>,
21        java_distribution: JavaDistribution,
22    ) -> Self {
23        Self {
24            username: username.into(),
25            uuid: uuid.into(),
26            java_distribution,
27        }
28    }
29}
30
31impl Default for LaunchConfig {
32    fn default() -> Self {
33        Self {
34            username: "Hamadi".to_string(),
35            uuid: "00000000-0000-0000-0000-000000000000".to_string(),
36            java_distribution: JavaDistribution::Temurin,
37        }
38    }
39}
40