aboutsummaryrefslogtreecommitdiff
path: root/server/src/interaction.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-08-13 12:48:31 +0200
committermetamuffin <metamuffin@disroot.org>2024-08-13 16:03:38 +0200
commit16ff78180669411326d42ea32d4a9260c018236c (patch)
treed7c6a7ab498bb1b4f9a3b3db99d54e8781216e05 /server/src/interaction.rs
parent11ff74f034aeec58c06dbe15a3f1ee650ef18c9f (diff)
downloadhurrycurry-16ff78180669411326d42ea32d4a9260c018236c.tar
hurrycurry-16ff78180669411326d42ea32d4a9260c018236c.tar.bz2
hurrycurry-16ff78180669411326d42ea32d4a9260c018236c.tar.zst
refactor server to use client-lib data model (breaks customers)
Diffstat (limited to 'server/src/interaction.rs')
-rw-r--r--server/src/interaction.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/interaction.rs b/server/src/interaction.rs
index 4630b536..2f58ed8f 100644
--- a/server/src/interaction.rs
+++ b/server/src/interaction.rs
@@ -1,3 +1,4 @@
+use hurrycurry_client_lib::{Involvement, Item};
/*
Hurry Curry! - a game about cooking
Copyright 2024 metamuffin
@@ -15,11 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-use crate::{
- data::Gamedata,
- game::{Involvement, Item},
-};
-use hurrycurry_protocol::{Recipe, Score, TileIndex};
+use hurrycurry_protocol::{Gamedata, Recipe, Score, TileIndex};
use log::info;
pub enum InteractEffect {
@@ -80,6 +77,7 @@ pub fn interact(
recipe: ri,
working: 1,
progress: 0.,
+ warn: false,
});
}
}
@@ -96,6 +94,7 @@ pub fn interact(
recipe: ri,
working: 1,
progress: 0.,
+ warn: false,
});
}
*this = Some(item);
@@ -180,11 +179,12 @@ pub fn tick_slot(
} else {
for (ri, recipe) in data.recipes() {
if recipe.supports_tile(tile) {
- if let Recipe::Passive { input, .. } = recipe {
+ if let Recipe::Passive { input, warn, .. } = recipe {
if *input == item.kind {
item.active = Some(Involvement {
recipe: ri,
progress: 0.,
+ warn: *warn,
working: 1,
});
return Some(TickEffect::Progress(recipe.warn()));