use strafesnet_common::model::{Mesh,MeshId};

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