diff options
Diffstat (limited to 'server/src/entity/mod.rs')
-rw-r--r-- | server/src/entity/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs index c471a6d4..ec5ec744 100644 --- a/server/src/entity/mod.rs +++ b/server/src/entity/mod.rs @@ -18,18 +18,18 @@ pub mod conveyor; pub mod customers; pub mod portal; -use std::collections::{HashMap, HashSet}; +use std::collections::{HashMap, HashSet, VecDeque}; use crate::{data::ItemTileRegistry, game::Game, interaction::Recipe}; use anyhow::{anyhow, Result}; use conveyor::Conveyor; use customers::{demands::generate_demands, Customers}; -use hurrycurry_protocol::{glam::IVec2, ItemIndex, TileIndex}; +use hurrycurry_protocol::{glam::IVec2, ItemIndex, PacketC, TileIndex}; use portal::Portal; use serde::{Deserialize, Serialize}; pub trait EntityT: Clone { - fn tick(&mut self, game: &mut Game, dt: f32) -> Result<()>; + fn tick(&mut self, game: &mut Game, packet_out: &mut VecDeque<PacketC>, dt: f32) -> Result<()>; } macro_rules! entities { @@ -37,8 +37,8 @@ macro_rules! entities { #[derive(Debug, Clone)] pub enum Entity { $($e($e)),* } impl EntityT for Entity { - fn tick(&mut self, game: &mut Game, dt: f32) -> Result<()> { - match self { $(Entity::$e(x) => x.tick(game, dt)),*, } + fn tick(&mut self, game: &mut Game, packet_out: &mut VecDeque<PacketC>, dt: f32) -> Result<()> { + match self { $(Entity::$e(x) => x.tick(game, packet_out, dt)),*, } } } }; |