2020-11-11 11:42:22 +00:00
|
|
|
use super::*;
|
|
|
|
use common::{
|
2020-11-15 01:40:23 +00:00
|
|
|
comp::Pos,
|
2020-11-11 11:42:22 +00:00
|
|
|
event::{EventBus, ServerEvent},
|
|
|
|
terrain::TerrainGrid,
|
|
|
|
};
|
2020-11-23 15:39:03 +00:00
|
|
|
use specs::{Entities, Read, ReadExpect, ReadStorage, System, WriteExpect};
|
2020-11-11 11:42:22 +00:00
|
|
|
|
|
|
|
pub struct Sys;
|
|
|
|
impl<'a> System<'a> for Sys {
|
2020-11-23 15:39:03 +00:00
|
|
|
#[allow(clippy::type_complexity)]
|
2020-11-11 11:42:22 +00:00
|
|
|
type SystemData = (
|
|
|
|
Read<'a, EventBus<ServerEvent>>,
|
|
|
|
WriteExpect<'a, RtSim>,
|
|
|
|
ReadExpect<'a, TerrainGrid>,
|
|
|
|
Entities<'a>,
|
|
|
|
ReadStorage<'a, RtSimEntity>,
|
|
|
|
ReadStorage<'a, Pos>,
|
|
|
|
);
|
|
|
|
|
|
|
|
fn run(
|
|
|
|
&mut self,
|
|
|
|
(
|
2020-11-23 15:39:03 +00:00
|
|
|
_server_event_bus,
|
2020-11-11 11:42:22 +00:00
|
|
|
mut rtsim,
|
2020-11-23 15:39:03 +00:00
|
|
|
_terrain_grid,
|
|
|
|
_entities,
|
|
|
|
_rtsim_entities,
|
|
|
|
_positions,
|
2020-11-11 11:42:22 +00:00
|
|
|
): Self::SystemData,
|
|
|
|
) {
|
2020-11-12 21:31:28 +00:00
|
|
|
let chunks = std::mem::take(&mut rtsim.chunks.chunks_to_unload);
|
2020-11-11 11:42:22 +00:00
|
|
|
|
2020-11-23 15:39:03 +00:00
|
|
|
for _chunk in chunks {
|
2020-11-11 23:59:09 +00:00
|
|
|
// TODO
|
2020-11-11 11:42:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|