wolfrpg_map_parser/command/db_management_command/
options.rs#[cfg(feature = "serde")]
use serde::Serialize;
use crate::command::db_management_command::db_type::DBType;
use crate::command::db_management_command::db_operation_type::DBOperationType;
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct Options {
db_type: DBType,
db_operation_type: DBOperationType
}
impl Options {
pub fn new(options: u8) -> Self {
Self {
db_type: DBType::new(options & 0x0f),
db_operation_type: DBOperationType::new(options >> 4),
}
}
pub fn db_type(&self) -> &DBType {
&self.db_type
}
pub fn db_type_mut(&mut self) -> &mut DBType {
&mut self.db_type
}
pub fn db_operation_type(&self) -> &DBOperationType {
&self.db_operation_type
}
pub fn db_operation_type_mut(&mut self) -> &mut DBOperationType {
&mut self.db_operation_type
}
}