use strafesnet_common::model::TextureId; pub enum Texture{ ImageDDS(Vec), } impl AsRef<[u8]> for Texture{ fn as_ref(&self)->&[u8]{ match self{ Texture::ImageDDS(data)=>data.as_ref(), } } } pub struct Textures{ textures:Vec, } impl Textures{ pub(crate) const fn new(textures:Vec)->Self{ Self{ textures, } } pub fn get_texture(&self,texture_id:TextureId)->Option<&Texture>{ self.textures.get(texture_id.get() as usize) } pub fn into_iter(self)->impl Iterator{ self.textures.into_iter().enumerate().map(|(texture_id,texture)|(TextureId::new(texture_id as u32),texture)) } }