use strafesnet_common::model::MeshId;

pub struct Meshes<M>{
	meshes:Vec<Option<M>>,
}
impl<M> Meshes<M>{
	pub(crate) const fn new(meshes:Vec<Option<M>>)->Self{
		Self{
			meshes,
		}
	}
	pub fn consume(self)->impl Iterator<Item=(MeshId,M)>{
		self.meshes.into_iter().enumerate().filter_map(|(mesh_id,maybe_mesh)|
			maybe_mesh.map(|mesh|(MeshId::new(mesh_id as u32),mesh))
		)
	}
}
