wolfrpg_map_parser/command/party_graphics_command/
operation.rs1#[cfg(feature = "serde")]
2use serde::{Serialize, Deserialize};
3
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(PartialEq, Clone)]
6pub enum Operation {
7 Remove = 0x00,
8 Insert = 0x01,
9 Replace = 0x02,
10 RemoveGraphic = 0x03,
11 Special = 0x04,
12 Unknown
13}
14
15impl Operation {
16 pub const fn new(operation: u8) -> Self {
17 match operation {
18 0x00 => Operation::Remove,
19 0x01 => Operation::Insert,
20 0x02 => Operation::Replace,
21 0x03 => Operation::RemoveGraphic,
22 0x04 => Operation::Special,
23 _ => Operation::Unknown
24 }
25 }
26}