mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add TODO
This commit is contained in:
parent
c10a43f541
commit
a69b5022c2
@ -23,14 +23,7 @@ fn main() {
|
||||
// TODO: Remove or move somewhere else, this doesn't work immediately after connecting
|
||||
println!("Ping: {:?}", client.get_ping_ms());
|
||||
|
||||
println!(
|
||||
"Players online: {:?}",
|
||||
client
|
||||
.get_players()
|
||||
.into_iter()
|
||||
.map(|(e, p)| p)
|
||||
.collect::<Vec<comp::Player>>()
|
||||
);
|
||||
println!("Players online: {:?}", client.get_players());
|
||||
|
||||
client.register(comp::Player::new("test".to_string(), None));
|
||||
client.send_chat("Hello!".to_string());
|
||||
|
@ -426,13 +426,13 @@ impl Client {
|
||||
}
|
||||
|
||||
/// Get a vector of all the players on the server
|
||||
pub fn get_players(&mut self) -> Vec<(EcsEntity, comp::Player)> {
|
||||
(
|
||||
&self.state.ecs().entities(),
|
||||
&self.state.ecs().read_storage::<comp::Player>(),
|
||||
)
|
||||
pub fn get_players(&mut self) -> Vec<comp::Player> {
|
||||
// TODO: Don't clone players.
|
||||
self.state
|
||||
.ecs()
|
||||
.read_storage::<comp::Player>()
|
||||
.join()
|
||||
.map(|(e, p)| (e, p.clone()))
|
||||
.map(|p| p.clone())
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user