use std::path::PathBuf; use serde::{Deserialize, Serialize}; use self::vanilla::VanillaClientProps; use super::{client::{ClientTrait, Cluster, Manifest}, minecraft::MinecraftVersion}; pub mod vanilla; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type")] pub enum ClientType { Vanilla(VanillaClientProps), } #[derive(Debug)] pub struct LaunchInfo { // This is where things like account info, features etc will go pub java: PathBuf } pub async fn get_versions(client: &ClientType, file: Option<&PathBuf>) -> crate::Result> { match client { ClientType::Vanilla(_) => vanilla::get_versions(file).await, } } pub fn get_impl<'a>(client: &'a ClientType, cluster: &'a Cluster, manifest: &'a Manifest) -> Box + 'a> { Box::new(match client { ClientType::Vanilla(_) => vanilla::VanillaClient::new(cluster, manifest), }) }