wolfrpg_map_parser/command/sound_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
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(PartialEq)]
pub enum Operation {
    SetBGM  = 0x00,
    SetBGS  = 0x01,
    SetSE   = 0x02,
    Unknown
}

impl Operation {
    pub const fn new(operation: u8) -> Self {
        match operation {
            0x00 => Operation::SetBGM,
            0x01 => Operation::SetBGS,
            0x02 => Operation::SetSE,
            _ => Operation::Unknown
        }
    }
}