summaryrefslogtreecommitdiff
path: root/server/src/entity/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/entity/mod.rs')
-rw-r--r--server/src/entity/mod.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs
index ddafc2f7..75ea0e9b 100644
--- a/server/src/entity/mod.rs
+++ b/server/src/entity/mod.rs
@@ -22,12 +22,14 @@ pub mod conveyor;
pub mod customers;
pub mod environment_effect;
pub mod item_portal;
+pub mod pedestrians;
pub mod player_portal;
pub mod tram;
pub mod tutorial;
use crate::{
data::{ItemTileRegistry, Serverdata},
+ entity::pedestrians::Pedestrians,
message::TrError,
scoreboard::ScoreboardStore,
};
@@ -45,7 +47,10 @@ use hurrycurry_protocol::{
use item_portal::ItemPortal;
use player_portal::PlayerPortal;
use serde::{Deserialize, Serialize};
-use std::{any::Any, collections::VecDeque};
+use std::{
+ any::Any,
+ collections::{HashMap, VecDeque},
+};
use tram::Tram;
pub type DynEntity = Box<dyn Entity + Send + Sync + 'static>;
@@ -143,6 +148,11 @@ pub enum EntityDecl {
smoothing: f32,
},
Book,
+ Pedestrians {
+ spawn_delay: f32,
+ spawn_delay_stdev: f32,
+ points: Vec<Vec2>,
+ },
}
pub fn construct_entity(
@@ -222,5 +232,15 @@ pub fn construct_entity(
spacing,
smoothing,
}),
+ EntityDecl::Pedestrians {
+ spawn_delay,
+ spawn_delay_stdev,
+ points,
+ } => Box::new(Pedestrians {
+ players: HashMap::new(),
+ points,
+ spawn_delay_distr: rand_distr::Normal::new(spawn_delay, spawn_delay_stdev).unwrap(),
+ cooldown: 0.,
+ }),
})
}