wolfrpg_map_parser/command/picture_command/
zoom.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(PartialEq)]
pub enum Zoom {
    Normal      = 0x00,
    Different   = 0x03,
    Same        = 0x04,
    Unknown
}

impl Zoom {
    pub const fn new(zoom: u8) -> Self {
        match zoom {
            0x00 => Zoom::Normal,
            0x03 => Zoom::Different,
            0x04 => Zoom::Same,
            _ => Zoom::Unknown
        }
    }
}