use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
pub struct OverlayFlags {
    pub asr: bool,
    pub asrx: bool,
    pub ocr: bool,
    pub yolo: bool,
    pub face: bool,
    pub pose: bool,
    pub status: bool,
}

impl Default for OverlayFlags {
    fn default() -> Self {
        Self {
            asr: false,
            asrx: false,
            ocr: false,
            yolo: false,
            face: false,
            pose: false,
            status: true,
        }
    }
}

impl OverlayFlags {
    pub fn toggle(&mut self, layer: char) {
        match layer {
            'a' => self.asr = !self.asr,
            'x' => self.asrx = !self.asrx,
            'o' => self.ocr = !self.ocr,
            'y' => self.yolo = !self.yolo,
            'f' => self.face = !self.face,
            'p' => self.pose = !self.pose,
            'b' => self.status = !self.status,
            _ => {}
        }
    }
}
