summaryrefslogtreecommitdiff
path: root/src/room.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/room.rs')
-rw-r--r--src/room.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/room.rs b/src/room.rs
index 9df131a..805f94e 100644
--- a/src/room.rs
+++ b/src/room.rs
@@ -228,6 +228,10 @@ impl <'a, 'b>Room<'a, 'b> {
}
}
+ pub fn has_players(&self) -> bool {
+ !self.world.read_component::<Player>().is_empty()
+ }
+
pub fn save_players(&self) -> HashMap<PlayerId, PlayerState> {
let mut states = HashMap::new();
let players = self.world.read_component::<Player>();