37 lines
804 B
Rust
37 lines
804 B
Rust
#[cfg_attr(feature = "json", derive(serde::Serialize))]
|
|
#[cfg_attr(feature = "json", serde(tag = "type", rename_all = "snake_case"))]
|
|
#[derive(Debug, Clone)]
|
|
pub enum EntityInfo {
|
|
Player {
|
|
name: String,
|
|
id: usize,
|
|
is_attacker: bool,
|
|
},
|
|
Weapon {
|
|
name: String,
|
|
owner: usize,
|
|
id: usize,
|
|
},
|
|
Armour {
|
|
name: String,
|
|
owner: usize,
|
|
id: usize,
|
|
},
|
|
Global,
|
|
}
|
|
|
|
#[cfg_attr(feature = "json", derive(serde::Serialize))]
|
|
#[derive(Debug)]
|
|
pub struct Counter {
|
|
pub value: u64,
|
|
pub entity: EntityInfo,
|
|
pub label: &'static str,
|
|
}
|
|
|
|
#[cfg_attr(feature = "json", derive(serde::Serialize))]
|
|
#[derive(Debug)]
|
|
pub struct Histogram {
|
|
pub values: Vec<u32>,
|
|
pub entity: EntityInfo,
|
|
pub label: &'static str,
|
|
}
|