Reduced backend resposibility to emmit game events, whole addon logic implemented in python side

This commit is contained in:
Wiktor Mazur
2020-02-18 16:55:33 +01:00
parent d73f34a33b
commit 133975cd77
78 changed files with 3203 additions and 1331 deletions
+1 -13
View File
@@ -12,7 +12,7 @@ use super::player::Player;
use super::traits::CombatState;
use super::types::PlayerStatisticsVec;
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct Session {
players: HashMap<String, Player>,
}
@@ -62,18 +62,6 @@ impl Session {
)
}
pub fn cleanup_players(&mut self) {
let without_dmg = self
.players
.iter()
.filter(|(_, player)| !player.main() && player.damage() == 0.0 && player.fame() == 0.0)
.map(|(name, _)| name.clone())
.collect::<Vec<String>>();
for w in without_dmg {
self.players.remove_entry(&w);
}
}
pub fn players(&self) -> Vec<&Player> {
self.players.iter().map(|(_, p)| p).collect()
}