summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-02-12 13:20:06 -0600
committertom barrett <spalf0@gmail.com>2019-02-12 13:20:06 -0600
commit070485e093dc540a5db9650d438cffe3d18d3883 (patch)
treea0ab1f42c844b3557c7f17b11f3c7eae334e853d /src/client
parent6a906ce663935e37d6dd79a2e2e31fb07ca7c2af (diff)
added constants file, made so items are referred to by an enum, figured better ways than ship_clone
Diffstat (limited to 'src/client')
-rw-r--r--src/client/construction.rs8
-rw-r--r--src/client/refinery.rs4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/construction.rs b/src/client/construction.rs
index b034b77..8cb812f 100644
--- a/src/client/construction.rs
+++ b/src/client/construction.rs
@@ -7,6 +7,7 @@ use std::io::{stdout, Read, Write};
use std::io::{BufRead, BufReader};
use std::net::TcpStream;
+use crate::constants;
use crate::modules::construction::ConstructionStatus;
use crate::server::construction::ConstructionData;
@@ -24,7 +25,7 @@ pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader<TcpStrea
let clear = termion::cursor::Goto(1, 1);
- if data.has_refined {
+ if data.has_enough {
match data.status {
ConstructionStatus::None => {
write!(stdout, "{}Press c to create a refinery.", clear).unwrap()
@@ -34,8 +35,9 @@ pub fn client_construction(mut stream: TcpStream, mut buff_r: BufReader<TcpStrea
} else {
write!(
stdout,
- "{}You need 5 refined minerals to create a refinery.",
- clear
+ "{}You need {} iron to create a refinery.",
+ clear,
+ constants::SHIP_CONSTRUCTION_IRON_COST
)
.unwrap();
}
diff --git a/src/client/refinery.rs b/src/client/refinery.rs
index caceda7..a3ae6f4 100644
--- a/src/client/refinery.rs
+++ b/src/client/refinery.rs
@@ -24,7 +24,7 @@ pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>)
let clear = termion::cursor::Goto(1, 1);
- if data.has_minerals {
+ if data.has_crude_minerals {
match data.status {
RefineryStatus::None => {
write!(stdout, "{}Press R to begin refining.", clear).unwrap()
@@ -32,7 +32,7 @@ pub fn client_refinery(mut stream: TcpStream, mut buff_r: BufReader<TcpStream>)
_ => write!(stdout, "{}Press R to stop refining.", clear).unwrap(),
};
} else {
- write!(stdout, "{}You have no refinable minerals.", clear).unwrap();
+ write!(stdout, "{}You have no crude minerals.", clear).unwrap();
}
if let Some(c) = stdin.next() {