summaryrefslogtreecommitdiff
path: root/src/modules/construction.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/construction.rs')
-rw-r--r--src/modules/construction.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/construction.rs b/src/modules/construction.rs
index 20f1688..6c27db5 100644
--- a/src/modules/construction.rs
+++ b/src/modules/construction.rs
@@ -2,6 +2,7 @@ use std::time::SystemTime;
use crate::constants;
use crate::modules::types::ModuleType;
+use crate::server::construction::ConstructionData;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub enum ConstructionStatus {
@@ -43,6 +44,14 @@ impl Construction {
}
}
+ pub fn give_recv(&mut self, recv: String, construction_data: &ConstructionData) {
+ if let "c" = recv.as_str() {
+ if construction_data.has_enough {
+ self.toggle()
+ }
+ }
+ }
+
pub fn toggle(&mut self) {
match self.status {
ConstructionStatus::None => self.on(),