per-player data wip

This commit is contained in:
Robin Appelman 2021-08-10 19:32:17 +02:00
commit 9da2d2230a
10 changed files with 341 additions and 127 deletions

View file

@ -19,7 +19,7 @@ struct HighestDamageHandler {
}
impl EventHandler for HighestDamageHandler {
type Output = Option<HighestDamage>;
type GlobalOutput = Option<HighestDamage>;
fn does_handle(&self, ty: RawEventType) -> bool {
matches!(ty, RawEventType::Damage)
@ -42,7 +42,7 @@ impl EventHandler for HighestDamageHandler {
}
}
fn finish(self, subjects: &SubjectMap) -> Self::Output {
fn finish_global(self, subjects: &SubjectMap) -> Self::GlobalOutput {
self.current.map(|(subject, damage)| {
let user = match &subjects[subject] {
SubjectData::Player { name, .. } => name.clone(),