Reduced backend resposibility to emmit game events, whole addon logic implemented in python side
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user