wolfrpg_map_parser/command/party_graphics_command/
operation.rs

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

#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum Operation {
    Remove          = 0x00,
    Insert          = 0x01,
    Replace         = 0x02,
    RemoveGraphic   = 0x03,
    Special         = 0x04,
    Unknown
}

impl Operation {
    pub const fn new(operation: u8) -> Self {
        match operation {
            0x00 => Operation::Remove,
            0x01 => Operation::Insert,
            0x02 => Operation::Replace,
            0x03 => Operation::RemoveGraphic,
            0x04 => Operation::Special,
            _ => Operation::Unknown
        }
    }
}