aboutsummaryrefslogtreecommitdiff
path: root/server/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/data.rs')
-rw-r--r--server/src/data.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/src/data.rs b/server/src/data.rs
index f0a85cca..021de525 100644
--- a/server/src/data.rs
+++ b/server/src/data.rs
@@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-use crate::entity::{construct_entity, Entity, EntityDecl};
+use crate::entity::{construct_entity, Entities, EntityDecl};
use anyhow::{anyhow, bail, Result};
use hurrycurry_protocol::{
glam::{IVec2, Vec2},
@@ -97,7 +97,7 @@ pub struct Demand {
pub points: i64,
}
-#[derive(Debug, Clone, Default)]
+#[derive(Debug,Clone, Default)]
#[rustfmt::skip]
pub struct Serverdata {
pub spec: String,
@@ -105,7 +105,6 @@ pub struct Serverdata {
pub chef_spawn: Vec2,
pub customer_spawn: Vec2,
pub score_baseline: i64,
- pub entities: Vec<Entity>,
}
#[derive(Debug, Deserialize, Default)]
@@ -144,7 +143,7 @@ impl DataIndex {
Ok(read_to_string(path).await?)
}
- pub async fn generate(&self, spec: String) -> Result<(Gamedata, Serverdata)> {
+ pub async fn generate(&self, spec: String) -> Result<(Gamedata, Serverdata, Entities)> {
let (map, recipes) = spec.split_once("-").unwrap_or((spec.as_str(), "default"));
let map_in = serde_yml::from_str(&self.read_map(map).await?)?;
@@ -166,7 +165,7 @@ pub fn build_data(
map_name: String,
map_in: InitialMap,
recipes_in: Vec<RecipeDecl>,
-) -> Result<(Gamedata, Serverdata)> {
+) -> Result<(Gamedata, Serverdata, Entities)> {
let reg = ItemTileRegistry::default();
let mut recipes = Vec::new();
let mut entities = Vec::new();
@@ -324,8 +323,8 @@ pub fn build_data(
chef_spawn,
customer_spawn,
score_baseline: map_in.score_baseline,
- entities,
},
+ entities,
))
}