aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-26 18:27:18 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-26 18:27:22 +0200
commit9c7673253f7dcc50d761345c3fdcd0d6d3654f3e (patch)
tree4a2c8c036f16e97c22767303a20d5be34635ef70 /server/src/entity/mod.rs
parenteb6527dec240c94d8cd27573c96c83cea2618cb3 (diff)
downloadhurrycurry-9c7673253f7dcc50d761345c3fdcd0d6d3654f3e.tar
hurrycurry-9c7673253f7dcc50d761345c3fdcd0d6d3654f3e.tar.bz2
hurrycurry-9c7673253f7dcc50d761345c3fdcd0d6d3654f3e.tar.zst
add draft weather/environment system
Diffstat (limited to 'server/src/entity/mod.rs')
-rw-r--r--server/src/entity/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs
index ad0bde6f..d042d458 100644
--- a/server/src/entity/mod.rs
+++ b/server/src/entity/mod.rs
@@ -19,6 +19,7 @@ pub mod conveyor;
pub mod customers;
pub mod item_portal;
pub mod player_portal;
+pub mod weather;
use crate::{data::ItemTileRegistry, game::Game, interaction::Recipe};
use anyhow::{anyhow, Result};
@@ -32,6 +33,7 @@ use item_portal::ItemPortal;
use player_portal::PlayerPortal;
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet, VecDeque};
+use weather::WeatherController;
pub trait EntityT: Clone {
fn tick(&mut self, game: &mut Game, packet_out: &mut VecDeque<PacketC>, dt: f32) -> Result<()>;
@@ -49,7 +51,13 @@ macro_rules! entities {
};
}
-entities!(Conveyor, ItemPortal, PlayerPortal, Customers);
+entities!(
+ Conveyor,
+ ItemPortal,
+ PlayerPortal,
+ Customers,
+ WeatherController
+);
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
@@ -71,6 +79,7 @@ pub enum EntityDecl {
to: Vec2,
},
Customers {},
+ Weather {},
}
pub fn construct_entity(
@@ -125,5 +134,6 @@ pub fn construct_entity(
.collect();
Entity::Customers(Customers::new(chairs, demands)?)
}
+ EntityDecl::Weather {} => Entity::WeatherController(WeatherController::default()),
})
}