use strafesnet_common::model::MeshId; #[derive(Clone)] pub struct RobloxMeshData(Vec); impl RobloxMeshData{ pub(crate) fn new(data:Vec)->Self{ Self(data) } pub fn get(self)->Vec{ self.0 } } pub struct Meshes{ meshes:Vec>, } impl Meshes{ pub(crate) const fn new(meshes:Vec>)->Self{ Self{ meshes, } } pub fn get_texture(&self,texture_id:MeshId)->Option<&RobloxMeshData>{ self.meshes.get(texture_id.get() as usize)?.as_ref() } pub fn into_iter(self)->impl Iterator{ self.meshes.into_iter().enumerate().filter_map(|(mesh_id,maybe_mesh)| maybe_mesh.map(|mesh|(MeshId::new(mesh_id as u32),mesh)) ) } }