use serde::{Serialize, Deserialize};

use super::plugin::Plugin;

/// Represents the type of Minecraft server
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum ServerType {
    Paper,
    Spigot,
    Bukkit,
    Vanilla,
    Forge,
    Fabric,
    Velocity,
    BungeeCord,
    Waterfall,
    Unknown,
}

/// Contains information about a Minecraft server
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ServerInfo {
    pub server_type: ServerType,
    pub minecraft_version: Option<String>,
    pub plugins_directory: String,
    pub plugins_count: usize,
}

/// Result of a server scan operation
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ScanResult {
    pub server_info: ServerInfo,
    pub plugins: Vec<Plugin>,
}

/// Progress information during a server scan
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ScanProgress {
    pub processed: usize,
    pub total: usize,
    pub current_file: String,
}