mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 18:24:09 +02:00
snapshot tests
This commit is contained in:
parent
a18068e957
commit
fbe3eee614
8 changed files with 1603 additions and 5 deletions
|
|
@ -190,6 +190,12 @@ impl<T: PartialEq> PartialEq for ClassMap<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> From<ClassMap<T>> for [T; 10] {
|
||||
fn from(value: ClassMap<T>) -> Self {
|
||||
value.0
|
||||
}
|
||||
}
|
||||
|
||||
/// Optimized subject id
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Debug, Ord, PartialOrd, Hash)]
|
||||
pub enum SubjectId {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ use std::collections::BTreeMap;
|
|||
|
||||
#[derive(Debug, Serialize, Default, PartialEq)]
|
||||
pub struct ClassStats {
|
||||
kills: ClassMap<u8>,
|
||||
deaths: ClassMap<u8>,
|
||||
assists: ClassMap<u8>,
|
||||
damage: ClassMap<u16>,
|
||||
pub kills: ClassMap<u8>,
|
||||
pub deaths: ClassMap<u8>,
|
||||
pub assists: ClassMap<u8>,
|
||||
pub damage: ClassMap<u16>,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -32,3 +32,12 @@ impl PlayerSpecificData for HealSpread {
|
|||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoIterator for HealSpread {
|
||||
type Item = (SteamId3, u32);
|
||||
type IntoIter = <BTreeMap<SteamId3, u32> as IntoIterator>::IntoIter;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.0.into_iter()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ macro_rules! handler {
|
|||
}
|
||||
|
||||
pub struct [<$name PerSubjectOutput>] {
|
||||
pub $($child: <$ty as $crate::EventHandler>::PerSubjectOutput),*
|
||||
$(pub $child: <$ty as $crate::EventHandler>::PerSubjectOutput),*
|
||||
}
|
||||
|
||||
impl serde::Serialize for [<$name PerSubjectOutput>] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue