summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connection.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/connection.rs b/src/connection.rs
index cfe642d..648e1e3 100644
--- a/src/connection.rs
+++ b/src/connection.rs
@@ -27,7 +27,7 @@ impl Connection {
let index = match result {
Some(index) => index,
None => {
- let mut ship = Ship::new(name);
+ let ship = Ship::new(name);
ships.push(ship);
ships.len() - 1
},
@@ -67,6 +67,11 @@ impl Connection {
match self.buff_r.read_line(&mut data) {
Ok(_result) => match data.as_bytes() {
b"5\n" => ships[self.index].location.0 += 1,
+ b"0\n" => ships[self.index].location.0 -= 1,
+ b"8\n" => ships[self.index].location.1 += 1,
+ b"2\n" => ships[self.index].location.1 -= 1,
+ b"4\n" => ships[self.index].location.2 += 1,
+ b"6\n" => ships[self.index].location.2 -= 1,
_ => (),
},
Err(_error) => println!("b{}", _error)