summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/construction.rs6
-rw-r--r--src/client/engines.rs4
-rw-r--r--src/client/mining.rs6
-rw-r--r--src/client/navigation.rs4
-rw-r--r--src/client/refinery.rs6
-rw-r--r--src/client/tractorbeam.rs12
6 files changed, 19 insertions, 19 deletions
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<TcpStream>) {
let stdout = stdout();
@@ -18,7 +18,7 @@ pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader<TcpStrea
loop {
let mut recv = String::new();
buff_r.read_line(&mut recv).unwrap();
- let data: ConstructionClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap();
+ let data: construction::ClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap();
write!(stdout, "{}", termion::clear::All).unwrap();
@@ -26,7 +26,7 @@ pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader<TcpStrea
if data.has_enough {
match data.status {
- ConstructionStatus::None => {
+ 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<TcpStream>) {
let stdout = stdout();
@@ -19,7 +19,7 @@ pub fn client_engines(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>) {
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<TcpStream>) {
let stdout = stdout();
@@ -17,7 +17,7 @@ pub fn client_mining(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>) {
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<TcpStream>) {
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<TcpStream>) {
let stdout = stdout();
@@ -17,7 +17,7 @@ pub fn client_navigation(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>
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<TcpStream>) {
let stdout = stdout();
@@ -17,7 +17,7 @@ pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>)
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<TcpStream>)
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<TcpStream>) {
let stdout = stdout();
@@ -17,7 +17,7 @@ pub fn client_tractorbeam(mut stream: TcpStream, mut buff_r: BufReader<TcpStream
loop {
let mut recv = String::new();
buff_r.read_line(&mut recv).unwrap();
- let data: TractorbeamClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap();
+ let data: tractorbeam::ClientData = serde_json::from_str(&recv.replace("\n", "")).unwrap();
write!(stdout, "{}", termion::clear::All).unwrap();
@@ -25,25 +25,25 @@ pub fn client_tractorbeam(mut stream: TcpStream, mut buff_r: BufReader<TcpStream
if data.has_target {
match data.status {
- TractorbeamStatus::None => 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