// Copyright (C) 2025 Christian Mauduit <ufoot@ufoot.org>

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use shortestpath::Gradient;

#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Team {
    gradient: Gradient,
    color: u32,
    name: String,
    fighter_count: usize,
}

impl Team {
    pub fn new(gradient: Gradient, color: u32, name: String) -> Self {
        Self {
            gradient,
            color,
            name,
            fighter_count: 0,
        }
    }

    pub fn gradient(&self) -> &Gradient {
        &self.gradient
    }

    pub fn gradient_mut(&mut self) -> &mut Gradient {
        &mut self.gradient
    }

    pub fn color(&self) -> u32 {
        self.color
    }

    pub fn set_color(&mut self, color: u32) {
        self.color = color;
    }

    pub fn name(&self) -> &str {
        &self.name
    }

    pub fn set_name(&mut self, name: String) {
        self.name = name;
    }

    pub fn fighter_count(&self) -> usize {
        self.fighter_count
    }

    pub fn set_fighter_count(&mut self, fighter_count: usize) {
        self.fighter_count = fighter_count;
    }
}
