From c6be289134c1f749884d269f955b39d39b604469 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Wed, 20 Feb 2019 13:09:11 -0600 Subject: new naming scheme --- src/client/construction.rs | 6 +++--- src/client/engines.rs | 4 ++-- src/client/mining.rs | 6 +++--- src/client/navigation.rs | 4 ++-- src/client/refinery.rs | 6 +++--- src/client/tractorbeam.rs | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/client') diff --git a/src/client/construction.rs b/src/client/construction.rs index 8549c09..28a91be 100644 --- a/src/client/construction.rs +++ b/src/client/construction.rs @@ -8,7 +8,7 @@ use std::io::{BufRead, BufReader}; use std::net::TcpStream; use crate::constants; -use crate::modules::construction::{ConstructionClientData, ConstructionStatus}; +use crate::modules::construction; pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -18,7 +18,7 @@ pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader { + construction::Status::None => { write!(stdout, "{}Press c to create a refinery.", clear).unwrap() } _ => write!(stdout, "{}Press c to cancel..", clear).unwrap(), diff --git a/src/client/engines.rs b/src/client/engines.rs index dc3799b..52af206 100644 --- a/src/client/engines.rs +++ b/src/client/engines.rs @@ -9,7 +9,7 @@ use std::net::TcpStream; use std::thread::sleep; use std::time::Duration; -use crate::modules::engines::EnginesClientData; +use crate::modules::engines; pub fn client_engines(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -19,7 +19,7 @@ pub fn client_engines(mut stream: TcpStream, mut buff_r: BufReader) { loop { let mut recv = String::new(); buff_r.read_line(&mut recv).unwrap(); - let engines_data: EnginesClientData = + let engines_data: engines::ClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap(); writeln!( diff --git a/src/client/mining.rs b/src/client/mining.rs index 84dfcb6..c9ad3dc 100644 --- a/src/client/mining.rs +++ b/src/client/mining.rs @@ -7,7 +7,7 @@ use std::io::{stdout, Read, Write}; use std::io::{BufRead, BufReader}; use std::net::TcpStream; -use crate::modules::mining::{MiningClientData, MiningStatus}; +use crate::modules::mining; pub fn client_mining(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -17,7 +17,7 @@ pub fn client_mining(mut stream: TcpStream, mut buff_r: BufReader) { loop { let mut recv = String::new(); buff_r.read_line(&mut recv).unwrap(); - let data: MiningClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap(); + let data: mining::ClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap(); write!(stdout, "{}", termion::clear::All).unwrap(); @@ -27,7 +27,7 @@ pub fn client_mining(mut stream: TcpStream, mut buff_r: BufReader) { if data.is_within_range { if data.astroid_has_minerals { match data.status { - MiningStatus::None => { + mining::Status::None => { write!(stdout, "{}Press F to begin mining.", clear).unwrap() } _ => write!(stdout, "{}Press F to stop mining.", clear).unwrap(), diff --git a/src/client/navigation.rs b/src/client/navigation.rs index 586ac9e..7e6959b 100644 --- a/src/client/navigation.rs +++ b/src/client/navigation.rs @@ -7,7 +7,7 @@ use std::io::{stdout, Read, Write}; use std::io::{BufRead, BufReader}; use std::net::TcpStream; -use crate::modules::navigation::NavigationClientData; +use crate::modules::navigation; pub fn client_navigation(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -17,7 +17,7 @@ pub fn client_navigation(mut stream: TcpStream, mut buff_r: BufReader loop { let mut recv = String::new(); buff_r.read_line(&mut recv).unwrap(); - let navigation_data: NavigationClientData = serde_json::from_str(&recv).unwrap(); + let navigation_data: navigation::ClientData = serde_json::from_str(&recv).unwrap(); write!( stdout, diff --git a/src/client/refinery.rs b/src/client/refinery.rs index a977e04..99d4be7 100644 --- a/src/client/refinery.rs +++ b/src/client/refinery.rs @@ -7,7 +7,7 @@ use std::io::{stdout, Read, Write}; use std::io::{BufRead, BufReader}; use std::net::TcpStream; -use crate::modules::refinery::{RefineryClientData, RefineryStatus}; +use crate::modules::refinery; pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -17,7 +17,7 @@ pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader) loop { let mut recv = String::new(); buff_r.read_line(&mut recv).unwrap(); - let data: RefineryClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap(); + let data: refinery::ClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap(); write!(stdout, "{}", termion::clear::All).unwrap(); @@ -25,7 +25,7 @@ pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader) if data.has_crude_minerals { match data.status { - RefineryStatus::None => { + refinery::Status::None => { write!(stdout, "{}Press R to begin refining.", clear).unwrap() } _ => write!(stdout, "{}Press R to stop refining.", clear).unwrap(), diff --git a/src/client/tractorbeam.rs b/src/client/tractorbeam.rs index 16508b5..74d912f 100644 --- a/src/client/tractorbeam.rs +++ b/src/client/tractorbeam.rs @@ -7,7 +7,7 @@ use std::io::{stdout, Read, Write}; use std::io::{BufRead, BufReader}; use std::net::TcpStream; -use crate::modules::tractorbeam::{TractorbeamClientData, TractorbeamStatus}; +use crate::modules::tractorbeam; pub fn client_tractorbeam(mut stream: TcpStream, mut buff_r: BufReader) { let stdout = stdout(); @@ -17,7 +17,7 @@ pub fn client_tractorbeam(mut stream: TcpStream, mut buff_r: BufReader write!( + tractorbeam::Status::None => write!( stdout, "{}Press o to pull, p to push, t to bring to 5m.", clear ) .unwrap(), - TractorbeamStatus::Push => write!( + tractorbeam::Status::Push => write!( stdout, "{}Press o to pull, p to stop pushing, t to bring to 5m.", clear ) .unwrap(), - TractorbeamStatus::Pull => write!( + tractorbeam::Status::Pull => write!( stdout, "{}Press o to stop pulling, p to push, t to bring to 5m.", clear ) .unwrap(), - TractorbeamStatus::Bring => write!( + tractorbeam::Status::Bring => write!( stdout, "{}Press o to pulling, p to push, t to stop bringing to 5m.", clear -- cgit v1.2.3