aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2024-07-23 14:02:35 +0200
committernokoe <nokoe@mailbox.org>2024-07-23 14:02:35 +0200
commitace81d7e1aa42738583d80028bcce058579e2ee6 (patch)
treec6653a77c5d064736bb482b9932151544d8a1c2d
parentff1821306194e9f84404aa0dc8597c98097b1dc8 (diff)
downloadhurrycurry-ace81d7e1aa42738583d80028bcce058579e2ee6.tar
hurrycurry-ace81d7e1aa42738583d80028bcce058579e2ee6.tar.bz2
hurrycurry-ace81d7e1aa42738583d80028bcce058579e2ee6.tar.zst
delete deprecated demands
-rw-r--r--data/demands/default.yaml37
-rw-r--r--data/demands/none.yaml15
-rw-r--r--server/src/data.rs8
-rw-r--r--server/src/state.rs9
4 files changed, 3 insertions, 66 deletions
diff --git a/data/demands/default.yaml b/data/demands/default.yaml
deleted file mode 100644
index fe7392f0..00000000
--- a/data/demands/default.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright 2024 metamuffin
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-- { from: sliced-tomato-plate, to: dirty-plate, duration: 10, points: 2 }
-- { from: bread-slice-plate, to: dirty-plate, duration: 10, points: 3 }
-- { from: steak-plate, to: dirty-plate, duration: 10, points: 4 }
-
-- { from: bread-slice-steak-plate, to: dirty-plate, duration: 15, points: 6 }
-- {
- from: bread-slice-sliced-tomato-plate,
- to: dirty-plate,
- duration: 15,
- points: 5,
- }
-- { from: sliced-tomato-steak-plate, to: dirty-plate, duration: 15, points: 5 }
-
-- {
- from: bread-slice-sliced-tomato-steak-plate,
- to: dirty-plate,
- duration: 20,
- points: 10,
- }
-
-- { from: tomato-soup-plate, to: dirty-plate, duration: 10, points: 5 }
-- { from: bread, duration: 0, points: 4 }
diff --git a/data/demands/none.yaml b/data/demands/none.yaml
deleted file mode 100644
index 3801ff95..00000000
--- a/data/demands/none.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright 2024 metamuffin
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
diff --git a/server/src/data.rs b/server/src/data.rs
index 408ea736..48540d72 100644
--- a/server/src/data.rs
+++ b/server/src/data.rs
@@ -121,7 +121,6 @@ pub struct Gamedata {
#[derive(Debug, Deserialize, Default)]
pub struct DataIndex {
pub maps: HashMap<String, MapMetadata>,
- pub demands: HashSet<String>,
pub recipes: HashSet<String>,
}
@@ -147,13 +146,6 @@ impl DataIndex {
let path = data_dir().join(format!("maps/{name}.yaml"));
Ok(read_to_string(path).await?)
}
- pub async fn read_demands(&self, name: &str) -> Result<String> {
- if !self.demands.contains(name) {
- bail!("unknown demands: {name:?}");
- }
- let path = data_dir().join(format!("demands/{name}.yaml"));
- Ok(read_to_string(path).await?)
- }
pub async fn read_recipes(&self, name: &str) -> Result<String> {
if !self.recipes.contains(name) {
bail!("unknown recipes: {name:?}");
diff --git a/server/src/state.rs b/server/src/state.rs
index 44b4078a..11c45933 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -44,7 +44,7 @@ enum Command {
},
/// Abort the current game
End,
- /// Download recipe/demand/map's source declaration
+ /// Download recipe/map's source declaration
Download {
/// Resource kind
#[arg(value_enum)]
@@ -52,7 +52,7 @@ enum Command {
/// Name
name: String,
},
- /// List all recipes, demands and maps
+ /// List all recipes and maps
List,
/// Send an effect
Effect { name: String },
@@ -69,7 +69,6 @@ enum Command {
enum DownloadType {
Map,
Recipes,
- Demand,
}
impl State {
@@ -202,15 +201,13 @@ impl State {
let source = match r#type {
DownloadType::Map => self.index.read_map(&name).await,
DownloadType::Recipes => self.index.read_recipes(&name).await,
- DownloadType::Demand => self.index.read_demands(&name).await,
}?;
bail!("{source}");
}
Command::List => {
bail!(
- "Maps: {:?}\nDemands: {:?}\nRecipes: {:?}",
+ "Maps: {:?}\nRecipes: {:?}",
self.index.maps.keys().collect::<Vec<_>>(),
- self.index.demands,
self.index.recipes
)
}