wolfrpg_map_parser/command/picture_command/
blending_method.rs

1#[cfg(feature = "serde")]
2use serde::{Serialize, Deserialize};
3
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(PartialEq, Clone)]
6pub enum BlendingMethod {
7    Normal      = 0x00,
8    Add         = 0x01,
9    Subtract    = 0x02,
10    Multiply    = 0x03,
11    Same        = 0x0f,
12    Unknown
13}
14
15impl BlendingMethod {
16    pub const fn new(blending_method: u8) -> Self {
17        match blending_method {
18            0x00 => BlendingMethod::Normal,
19            0x01 => BlendingMethod::Add,
20            0x02 => BlendingMethod::Subtract,
21            0x03 => BlendingMethod::Multiply,
22            0x0f => BlendingMethod::Same,
23            _ => BlendingMethod::Unknown
24        }
25    }
26}