mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
19 lines
384 B
Rust
19 lines
384 B
Rust
#[repr(i16)]
|
|
#[derive(Debug, Clone, Copy)]
|
|
pub enum MessageType {
|
|
ClientMsg = 48,
|
|
ServerMsg = 49,
|
|
RobotMotion = 50,
|
|
}
|
|
|
|
impl MessageType {
|
|
pub fn from_i16(num: i16) -> Option<Self> {
|
|
match num {
|
|
48 => Some(Self::ClientMsg),
|
|
49 => Some(Self::ServerMsg),
|
|
50 => Some(Self::RobotMotion),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|