diff options
Diffstat (limited to 'src/dashboard.rs')
-rw-r--r-- | src/dashboard.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dashboard.rs b/src/dashboard.rs new file mode 100644 index 0000000..3a3ec2b --- /dev/null +++ b/src/dashboard.rs @@ -0,0 +1,18 @@ +use std::io::BufReader; +use std::io::BufRead; +use std::net::TcpStream; + +extern crate serde_json; + +use ship::Ship; + +pub fn Dashboard(mut buff_r : BufReader<TcpStream>) { + loop { + let mut data = String::new(); + buff_r.read_line(&mut data).unwrap(); + let ship : Ship = serde_json::from_str(&data).unwrap(); + println!("Location: ({},{},{})", ship.location.0, + ship.location.1, + ship.location.2); + } +} |